printf(“yes”) else
printf(“no”)
}
23. #include
float max(floata, float b) {float t=a
if(b>t)t=b return t } main() {float a,b,c
printf(“Input a,b,c:”)
scanf(“%f%f%f”,&a&b&c) printf(“%f”,max(max(a,b),c)) }
24. #include
float min(int a,int b,int c) {float temp
if(a>b) {
temp=a b=temp a=b; } if(a>c) {
temp=a c=temp a=c; }
return a } main() {
float x,y,z,s
scanf(“%f%f%f”,&x&y&z) s=min(x,y,z)
printf(“the smallest number is %f”,s) }
25. #include
long s=1;
int i;
for(i=1;i<=n;i++) s=s*i return s;
}
main() { int j
int sum=0
for(j=1;j<=10;j++) sum=sum+fac(j)
printf(“\\nThe sum is ”,sum); }
26. #include
s=a*b/2.0 return s }
main() { int a,b
float area
float s(int a,int b)
scanf(“%d%d”,&a&b) area=s(a,b)
printf(“ %.2f”,area) }
27. #include
float s s=PI*r*r return s }
main() { int r float s
printf(“\\nEnter r :”) scanf (“%d”,&r) s=area(r)
printf(“ %.2f”,s) }
28. #include
float s if(n<10) s=p*n else
if(n>=10&&n<20) s=p*n*0.9 else
if(n>=20) s=p*n*0.8 return s } main() {
int n float p float sum
printf(“\\nEnter p,n :”) scanf (“%f%d”,&p&n) sum=fun(p,n)
printf(“%.2f”,sum) }
29. #include
int right_triangle(int a,int b,int c) {int temp
if(c>a) {
temp=c c=a; a=temp } if(c
temp=c c=b; b=temp }
if(a*a+b*b==c*c) return 1 else return 0 }
main() {
int x,y,z,s
printf(“\\nEnter x,y,z :”)
scanf(“%d%d%d”,&x&y&z) s= right_triangle (x,y,z) if(s==1)
printf(“yes”) else
printf(“no”) }
30. #include
int i,temp if(a
temp=a a=b b=temp }
for(i=a;i<=a*b;i++) if(i%a==0&&i%b==0) {
return i break } } main() {
int m,n,s
printf(“\\nEnter m,n:”) scanf(“%d%d”,&m&n) s=f(m,n)
printf(“%d”,s) }
31. #include
{int a,b,c; int t; clrscr();
scanf(“%d%d%d”,&a,&b,&c); if(a
if(b printf(“MMM”,a,b,c); 32.main() {inta,b,c;flaot ave,sum=0; scanf(“%d%d%d”,&a,&b,&c); sum=a+b+c ave=sum/3 printf(“%f%f”,ave,sum);} 33. #include float perimeter(int m,int n) {double x,y,z; x=m*m+n*n y=sqrt((double)x); z=m+n+y return z;} main() {int a,b; float l; float perimeter(int a,int b); scanf(“%d%d”,&a,&b); l= perimeter(a,b); printf(“%.2f”,l); } 34. #include scanf(“%f%f”,&r,&h); v=PI*r*r*h; printf(\\n%8.2f,v); } 35. #include {float a,b,h,s; scanf(“%f,%f,%f”,&a,&b,&h); s=(a+b)*h/2.0; printf(“\\n%8.2f”,s); } 36. #include int i,j,a[N],sum=0,count;