Write a program to find the cube of a number entered by the user
Answers
Answered by
0
Answer:
#include <stdio.h>
void main()
{
int i,ctr;
printf("Input number of terms : ");
scanf("%d", &ctr);
for(i=1;i<=ctr;i++)
{
printf("Number is : %d and cube of the %d is :%d \n",i,i, (i*i*i));
}
}
I think this would help you. Follow me
Answered by
0
Explanation:
import.java.util.*
class cube
{
public void main( )
{
Scanner sc = new Scanner (System.in);
int s,p,
System.out.println("Enter any value"),
s = sc.nextInt( ),
p = s*s*s;
System.out.prinltn (p),
}
}
Similar questions