Cube in C++
Posted on 8:33 PM by Azailg
The given codes is for the program in solving Cube in C++ Programming.
#include < stdio.h >
main()
{
int a,b;
char choice;
start:
printf("Enter a number to be cube: ");
scanf("%d",&a);
b=a*a*a;
printf("the cube of %d is %d\n",a,b);
printf("Do you want to try it again? (y/n)\n");
scanf("%s",&choice);
if(choice=='y')
goto start;
else
return 0;
}
It solves the cube of a number. Just input a number to be cube and it will come up an answer.
0 comments:
Post a Comment