Preview

Lab Assignment: C Language Program

Good Essays
Open Document
Open Document
1616 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Lab Assignment: C Language Program
R .B.S COLLEGE OF TECHNOLOGY AND MANGEMENT
----------------------------------------------------------------------
AGRA B.C.A FIRST SEMESTER >>>> LAB ASSINGMENT>>>>
---------------------------------------------------------------------------
1- Write a program to compute area and circumference of a circle.
Program-

#include<stdio.h>
#include<conio.h>
Void main()
{
float radius,circumference,area; clrscr(); printf(“the radius of circle= ”); scanf(“%f”,radius); circumference=2*3.14*radius; area=3.14*radius*radius; printf(“the area of circle=%f \n the circumference=%f”,area,circumference); getch(); }

2- Write a program converts a temperature from Celsius to Fahrenheit. Use the following formula: F = 1.8 x C + 32 .
Program-
#include<stdio.h>
#include<conio.h>
void main() float celsius, farenheit; clrscr(); printf(“temperature in celsius= ”); scanf(“%f”,celsius); farenheit=1.8*c+32; printf(“\nthe temp in farenheit=%f”,farenheit); getch(); }

3- Write a complete C Program that prompts the user for the Cartesian Coordinates of two points (x1, y1) and (x2, y2 ) and displays the distance between them computed using the following formula :
Distance =
Program-
#include<stdio.h>
#include<math.h>
#include<conio.h>
Void main()
{
float x1,x2,y1,y2,distance; clrscr(); printf(“the co-ordinates are=”); scanf(“%f %f %f %f”, &x1,&x2,&y1,&y2); distance=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); printf(“distance=%f”,distance); getch(); }
4. Write a program that reads the lengths of two sides of a triangle and the angle between them and calculates the length of the third side using the following formula: Program-
#include<stdio.h>
#include<math.h>
#include<conio.h>
Void main()
{
float side1,side2 ,side3,angle;
clrscr();

You May Also Find These Documents Helpful

  • Satisfactory Essays

    = z) return true; else return false; } Problem 5 a. Output: 720 b. Output: 0 c. Output: 71 d. Output: 362880 Problem 6 a. Output: “Take Programming I.” b. Output:…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    PT1420 Chapter 3 Review

    • 1062 Words
    • 8 Pages

    3. Write assignment statements that perform the following operations with the variables a, b, and c.…

    • 1062 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Write a program that can be used by a small theater to sell tickets for performances. The theater’s auditorium has 15 rows of seats, with 20 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theater. Seats that are taken are represented by an * symbol and seats…

    • 703 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Find the circumference of circle S in which A Step 1 Use the given area to solve for r. A 81 cm…

    • 3056 Words
    • 13 Pages
    Good Essays
  • Satisfactory Essays

    Chapter 10

    • 536 Words
    • 3 Pages

    4. Find the area of the triangle with ∠A = 86, b = 4 ft, and c = 3 ft. Round your answer to two decimal places.…

    • 536 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Temperature Measurements: Look closely at the thermometer and record to the best number of significant figures, +/- 0.1 oC. In other words report, for example 24.0 oC, not 24 oC. Calculate the last 2 columns. (1 point)…

    • 1509 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    3. Write assignment statements that perform the following operations with the variables a, b, and c.…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Comp122 Week 2 Homework

    • 301 Words
    • 2 Pages

    4. Write a C++ statement that uses the manipulator 'setfill' to output a line containing 35 asterisk characters.…

    • 301 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    UNIT 2

    • 470 Words
    • 3 Pages

    5.) Write the pseudocode for a program that will determine the average miles per gallon a car gets. (Inputs should be miles driven and gallons of gas used)…

    • 470 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 1 Test Part 2

    • 512 Words
    • 2 Pages

    Answer the questions below. You may use a drawing compass, ruler, and calculator. When you are finished, submit this test to your teacher by the due date for full credit.…

    • 512 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Cs Programming Chapter 1

    • 2450 Words
    • 10 Pages

    ____ data items may involve organizing or sorting them, checking them for accuracy, or performing calculations with them.…

    • 2450 Words
    • 10 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Design a modular program that asks the user to enter a distance in kilometers, and the converts that distance to miles. The conversion formula is as follows:…

    • 620 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    3. Write assignment statements that perform the following operations with the variables a, b, and c.…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Good Essays

    Donnell Furlow Summary

    • 476 Words
    • 2 Pages

    Thesis: By including “Donnell Furlow” in her collection, the editor intended to explore the different effects that growing up surrounded by drugs and violence has on people. “Donnell Furlow” appeals to readers’ emotions by demonstrating how Donnell’s heart-wrenching situation led to his moral ambiguity and blurs the line between good and evil. Donnell grows up in the Rockwell Garden project, a low-income housing community rife with gangs and the problems they provoke, such as violence and drug use. Donnell’s two older brothers were both involved with this lifestyle, and dragged Donnell in at a tragically early age. As he recounts, “by the time I was in grammar school, I was learning how to clean guns, how to shoot a gun, how to hide a gun, how to bag up cocaine and how to shake dope……

    • 476 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    These numbers do not necessarily added up as we would hope, there is always crime, therefore for the number of crimes regardless of where or why type is always growing and…

    • 493 Words
    • 2 Pages
    Satisfactory Essays

Related Topics