C Program To Find Area and Circumference of Circle
C Program To Find Area and Circumference of Circle
int rad;
float PI = 3.14, area, ci;
ci = 2 * PI * rad;
printf("\nCircumference : %f ", ci);
getch();
}
output
Enter radius of a circle : 1
Area of circle : 3.14
Circumference : 6.28
2. Area of Circle
#include<stdio.h>
#include<conio.h>
void main() {
float radius, area;
getch();
}
output
Enter the radius of Circle : 2.0
Area of Circle : 6.14
int main() {
int a, b;
a = a + b;
b = a - b;
a = a - b;
return (0);
}
Output :
Enter value for num1 & num2 : 10 20
sum = s1 + s2 + s3 + s4 + s5;
printf("\nSum : %d", sum);
return (0);
}
Output :
Enter marks of 5 subjects : 80 70 90 80 80
Sum : 400
Percentage : 80.00
#include <stdio.h>
int main()
{
int n;
printf("Enter an integer\n");
scanf("%d", &n);
if (n%2 == 0)
printf("Even\n");
else
printf("Odd\n");
return 0;
}
output
Enter an integer
5
Odd
#include <stdio.h>
int main(){
float a, b, c;
printf("Enter three numbers: ");
scanf("%f %f %f", &a, &b, &c);
if (a>=b)
{
if(a>=c)
printf("Largest number = %.2f",a);
else
printf("Largest number = %.2f",c);
}
else
{
if(b>=c)
printf("Largest number = %.2f",b);
else
printf("Largest number = %.2f",c);
}
return 0;
}
output