C Program for Call by Value and Return by Value
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
// Program for call by value and return by value
#include<stdio.h>
#include<conio.h>
int factorial(int);
int reverse(int);
float area(float r);
void main()
{
float A;
A=area(12.33);
printf("Area is %f",A);
// int x,y;
// printf("Enter a number");
// scanf("%d",&x);
// y=reverse(x);
// printf("\nReverse is %d",y);
// if(x==y)
// printf("\nNo is Palindrom...");
// else
// printf("\nNo is not Palindrom...");
// y=factorial(x);
// printf("Factorial is %d",y);
}
// Developer Task
int factorial(int n)
{
int f=1;
while(n!=0)
{
f=f*n;
n--;
}
return(f);
}
int reverse(int n)
{
int r,s=0;
while(n!=0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
return(s);
}
float area(float r)
{
float A;
A=3.14*r*r;
return(A);
}
We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

