C program to find square and cube of a given number:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#include<stdio.h> int main() { int n; printf("Enter a number"); scanf("%d",&n); printf("\nSquare of the number %d is %d",n,n*n); printf("\nCube of the number %d is %d",n,n*n*n); return 0; } |