Sunday 16 August 2015

Beginner Program in C

1-

/*wap to the expression*/
#include<stdio.h>
int main()
{
int a,b,exp;
printf("enter the value of a and b\n");
scanf("%d%d",&a,&b);
exp=a*a+b*b*b+10000;
printf("exp=%d",exp);
return 0;
}

2-

/*write a program to calculate the simple interest*/
#include<stdio.h>
int main()
{
int p,r,t;
float si;
clrscr();
printf("enter the values of p,r and t");
scanf("%d%d%d",&p,&r,&t);
si=p*r*t/100.0;
printf("si=%f",si);
return 0;
}