WAP To calculate Simple Interest using pointer.

5/5 - (1 vote)
#include<stdio.h>
#include<conio.h>
void main()
{
 float p,r,t,si,*p1,*p2,*p3;
 clrscr();
 p1=&p;
 p2=&r;
 p3=&t;
 printf("Enter principal amount: ");
 scanf("%f",p1);
 printf("Enter rate of interest: ");
 scanf("%f",p2);
 printf("Enter time: ");
 scanf("%f",p3);
 si=(*p1**p2**p3)/100;
 printf("\n\nSimple Interest = %f",si);
 getch();
}
Sharing Is Caring:

Leave a Comment

Slide to prove you're not a bot/spammer *