Week 3
Week 3
Program:
/* C program to find the Compound Interest */
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main()
{
float p,r,t,ci;
clrscr();
printf("Enter Principle, Rate and Time: ");
scanf("%f%f%f",&p,&r,&t);
ci=p*pow((1+r/100),t);
printf("Compound Interest = %f", ci);
getch();
return 0;
}
(Leave 6 lines space for output)
Program:
Program:
/* C Program for finding distance travelled by an object*/
#include<stdio.h>
#include <conio.h>
int main()
{
float u,a,d;
int t;
clrscr();
printf("Enter acceleration: ");
scanf("%f",&a);
printf("Enter initial velocity: ");
scanf("%f",&u);
printf("Enter time : ");
scanf("%d",&t);
d = (u * t) + (a * t * t)/2;
printf("The Distance travelled by an object is : %f", d);
getch();
return 0;
}
(Leave 8 lines space for output)