You are on page 1of 3

#include <stdio.

h>
#include <conio.h>
main()
{
int a,b,c,d,e,sum;
float per;
printf("enter marks");
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
sum = a+b+c+d+e;
per = sum/5;
printf("sum is %d & percentage is %f",sum,per);
}
________________________________________________________________________________
________
#include <stdio.h>
#include <conio.h>
main()
{ float l,b,r,recar,recper,cirar,cirper;
printf("enter length breadth radius");
scanf("%f %f %f",&l,&b,&r);
recar = l*b;
recper = 2*(l+b);
cirar = 3.14*r*r;
cirper = 2*3.14*r;
printf("area of rectangle is %f & perimeter is %f, area of circle is %f & perime
ter is %f",recar,recper,cirar,cirper);
}
________________________________________________________________________________
_________
#include <stdio.h>
#include <conio.h>
main()
{
int a,b,t;
printf("enter value for a and b");
scanf("%d %d",&a,&b);
t=a;
a=b;
b=t;
printf("now the values for a and b has become a=%d, b=%d",a,b);
}
________________________________________________________________________________
_____
#include <stdio.h>
#include <conio.h>
main()
{
int a,b;
printf("enter value for a & b\n");
scanf("%d %d",&a,&b);
b=b-a;
a=a+b;
b=a-b;
printf("now the values are a=%d & b=%d",a,b);
}

________________________________________________________________________________
__
#include <stdio.h>
#include <conio.h>
#include <math.h>
main()
{
int num,r,s,t,u,v,sum;
printf("enter 3 digit number\n");
scanf("%d",&num);
r=num%10;
s=num/10;
t=s%10;
u=s/10;
v=u%10;
sum=r+t+v;
printf("sum of the digits is: %d",sum);
}
________________________________________________________________________________
__
#include <stdio.h>
#include <conio.h>
#include <math.h>
main()
{
int num,r ,s,t,u,v,sum=0;
printf("enter a 3 digit number\n");
scanf("%d",&num);
r=num%10;
sum=sum*10+r;
s=num/10;
t=s%10;
sum=sum*10+t;
u=s/10;
v=u%10;
sum=sum*10+v;
printf("reverse no is %d",sum);
}
________________________________________________________________________________
______
#include <stdio.h>
#include <conio.h>
main()
{
int num,p,q,r,s,t,u;
printf("enter a 3 digit number");
scanf("%d",&num);
p=num%10;
p=p+1;
p=p%10;
q=num/10;
r=q%10;
r=r+1;
r=r%10;

s=q/10;
t=s%10;
t=t+1;
t=t%10;
u=t*100+r*10+p;
printf("result is %d",u);
}

You might also like