//With return value, with argument .. square of number
#include<stdio.h>
#include<conio.h>
int sqr(int);
void main()
{
int no, s;
clrscr();
printf("\nEnter number: ");
scanf("%d", &no);
s = sqr(no);
printf("\n\nSquare of number is %d", s);
getch();
}
int sqr(int x)
{
return x*x;
}
No comments:
Post a Comment