Q:

C PROGRAM TO FIND SQUARE AND CUBE OF A GIVEN NUMBER

0

C PROGRAM TO FIND SQUARE AND CUBE OF A GIVEN NUMBER

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#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;
 
}

outputs:

Enter a number 2

Square of the number 2 is 4

Cube of the number 2 is 8

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now