C program to find square of a number using functions

				
					#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int sqr(int); 
int r,a; 
clrscr(); 
printf(“enter any no: ”);
scanf(“%d”,&a); r=sqr(a); 
printf(“square is : %d”,r); getch(); 
} 
int sqr(int x) 
{ 
return(x*x); 
}
				
			
Output: 
enter any no: 5
square is : 25

Leave a Reply