printf (“\n Simple Interest is of %d”, s);
getch ();
}
Output: put value of p=1000, r=2, t=1
Simple interest is = 20
5. W.A.P to calculate the perimeter of circle & rectangle?
# include <stdio.h>
# include <conio.h>
void main ()
{
int a, l, b, r;
clrscr ();
printf (“Enter the value of l & b & r”);
scanf (“%d%d%d”, &l, &b, &r);
A=2*a+b;
B=2*3.14*r;
printf (“\n Perimeter of rect. & circle is of %d\n%d”, a, b);
getch ();
}
Output: put l=6,b=8,r=4
Answer is = 20,25
6. W.A.P to enter basic salary, da, hpa, pf & calculate total salary & net
salary?
# include <stdio.h>
# include <conio.h>
Void main ()
{
Int ts, ns, bs, da, hpa, pf;
Clrscr ();
Printf (“Enter the value of bs & da & hpa & pf”);
Scanf (“%d%d%d%d”, &bs, &da, &hpa, &pf);
Ts=bs+hpa+da;
Ns=ts-pf;
Printf (“\n TS & NS is of %d\n%d”, ts, ns)
Getch ();
}
Output: put bs=67, da=67, hpa=56, pf=87;
Answer is = Ts=190, Ns=103