Function Program17

//with return value, no argument .. square of number


#include<stdio.h>

#include<conio.h>


int sqr();


void main()

{

int s;


clrscr();


// s = sqr();   // Another method


printf("Square = %d", sqr());


getch();

}


int sqr()

{

int no;


printf("\nEnter number: ");

scanf("%d", &no);


return no*no;

}

No comments:

Post a Comment