C Program to find square and cube of given number


This content was proof-read by Grammarly. You can Try Grammary for FREE

Problem Statement

You need to write a program in C to find the square and cube of a given number.

Solution

#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;
}
%d bloggers like this: