google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to demonstrate function with argument and return value in c - 2nd puc computer science

Write a program to demonstrate function with argument and return value in c

Write a program to demonstrate function with argument and return value in c

#include<stdio.h>

#include<conio.h>

void main()

{

float simple(float,float,float);

float p,t,r;

clrscr();

printf("Enter the principal, time and rate of interest:\n");

scanf("%f%f%f",&p,&t,&r);

printf("Simple interest=%f",simple(p,t,r));

getch();

}

float simple(float p,float t,float r)

{

return(p*t*r/100);

}

Output:

Enter the principal, time and rate of interest:

2000                                                                           

2                                                                              

5                                                                              

Simple interest=200.000000

Write a program to demonstrate function with argument and return value in c Write a program to demonstrate function with argument and return value in c Reviewed by Vision Academy on December 14, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.