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

Sunday, November 2, 2014

program to print square and cube of numbers between a given range by user in C.



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

/* program to print square and cube of numbers between range*/

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

printf("\nEnter Start number:");
scanf("%d",&br);
printf("\nEnter End number:");
scanf("%d",&ij);
printf("\n--------------------");

for(i=br;i<=ij;i++)
{
sq=i*i;
cu=i*sq;
printf("\n\t Number:%d",i);
printf("\n\t Square:%d",sq);
printf("\n\t Cube  :%d",cu);

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

}

getch();
}

No comments: