FIND SQUARE AND CUBE OF A GIVEN NUMBER
Below code find square and cube of a given number in C#include<stdio.h>
#include<conio.h>
int squre(int);
int qube(int);
void main()
{
int num;
clrscr();
printf("ENTER ANY NUMBER ");
scanf("%d",&num);
printf("\nSQURE OF %d IS = %d",num,squre(num));
printf("\n\nCUBE OF %d IS = %d",num,qube(num));
getch();
}
int squre(int num)
{
int ans;
ans=num*num;
return(ans);
}
int qube(int num)
{
int ans;
ans=num*num*num;
return(ans);
getch();
}
Output
No comments:
Post a Comment