/*To find the square using function*/
#include<stdio.h>
#include<conio.h>
void main()
{
int square(int);
int a,b;
clrscr();
printf("enter the value of a:: ");
scanf("%d",&a);
b=square(a);
printf("square is %d ::",b);
getch();
}
int square(int x)
{
int y;
y=x*x;
return(y);
}
/************************OUTPUT***************************
enter the value of a:: 12
square is::144 */
No comments:
Post a Comment