Program To Find The Average of Five Numbers: Source Code
Program To Find The Average of Five Numbers: Source Code
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();
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: