1.
#include <stdio.h>
int main ()
{
int a
, b, c;
a =
87;
b =
15;
c = a
- b;
printf("The
difference between %d and %d is %d", a, b, c);
return
0;
}
2.
#include <stdio.h>
int main (void)
{
int sum;
/* COMPUTE RESULTS */
sum = 25 + 37 - 19;
/*display results;*/
printf("The result is %i\n", sum);
return 0;
}
3.
The result is 95
4.
d = d
5.
#include <stdio.h>
int main()
{
float unit_price, cost_price;
unit_price = 10.50;
cost_price = 5*unit_price;
printf("\nCostprice of 5 items is %.2f", cost_price);
return 0;
}
6.
#include <stdio.h>
int main()
{
const
float pi = 3.142;
int l;
float
r, d;
l =
67;
r =
21/2;
d =
(2*l)+(2*pi*r);
printf("\nThe
distance if the running track is %.2fm", d);
return 0;
}
0 Comments
Post a Comment