C Program to Compute Square and Cube of Number
Write C Program to Find Square and and Cube of Given Number
#include<stdio.h> int main() { long n,square,cube; printf("Enter the number :--> "); scanf("%d", &n); square = n * n; cube = n * n * n; printf("Square of the number :--> %ld", square); printf("\nCube of the number :--> %ld", cube); return 0; }
Output:
Enter the number :--> 3
Square of the number :--> 9
Cube of the number :--> 27