Brijmohan lal Sahu - Facebook
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, November 2, 2014

Program to print square and cube of any number in C.



Code Box
-------------------------------------

/* program to print a square and cube of any number */

#include<stdio.h>
#include<conio.h>
void main()
{
int a,sq,cu;

printf("\nEnter a number:");
scanf("%d",&a);
sq=a*a;
cu=a*sq;

printf("\n--------------------");
printf("\n\t Number:%d",a);
printf("\n\t Square:%d",sq);
printf("\n\t Cube  :%d",cu);

printf("\n--------------------");

getch();
}

No comments: