0% found this document useful (0 votes)
15 views

Program To Find The Average of Five Numbers: Source Code

The document contains the source code and output for 4 programs: 1) A program to find the average of 5 numbers 2) A program to calculate the area of a triangle 3) A program to calculate the area of a circle 4) A program to convert from Fahrenheit to Celsius

Uploaded by

Manav Narula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Program To Find The Average of Five Numbers: Source Code

The document contains the source code and output for 4 programs: 1) A program to find the average of 5 numbers 2) A program to calculate the area of a triangle 3) A program to calculate the area of a circle 4) A program to convert from Fahrenheit to Celsius

Uploaded by

Manav Narula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

PROGRAM TO FIND THE AVERAGE OF FIVE

NUMBERS
SOURCE CODE:
#include <stdio.h>
#include <conio.h>
int main()
{
float a,b,c,d,e;
float avg;
clrscr();
printf("Enter the numbers: ");
scanf("%f %f %f %f %f",&a, &b, &c, &d, &e);
avg= (a+b+c+d+e)/5;
printf("Average is: %f",avg);
getch();
return 0;
}

OUTPUT:
PROGRAM TO FIND THE AREA OF THE TRIANGLE
SOURCE CODE:
#include<math.h>
#include<conio.h>
#include<stdio.h>
void main()
{
float a,b,c,s,area;
clrscr();
printf("enter the values of a,b,c");
scanf("%f %f %f",&a,&b,&c);
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("the area of a trangle is : %f ",area);
getch();
}

OUTPUT:
PROGRAM TO FIND THE AREA OF A CIRCLE
SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
float radius,area;
clrscr();

printf("Enter the Radius of a Circle : ");


scanf("%f",&radius);
area = 3.14*radius*radius;
printf("Area of Circle is: %f",area);
getch();
}

OUTPUT:
PROGRAM TO CONVERT FAHRENHEIT TO CELSIUS
SOURCE CODE:
#include <stdio.h>
#include <conio.h>
int main()
{
float celsius, fahrenheit;
clrscr();
printf("Please Enter the temperature in Fahrenheit: \n");
scanf("%f", &fahrenheit);
celsius = (fahrenheit - 32) * 5 / 9;
printf("\n %.2f Fahrenheit = %.2f Celsius", fahrenheit, celsius);
getch();
return 0;
}

OUTPUT:

You might also like