Write a program in C to check whether a given number is a perfect cube or not a perfect cube
- برمجة سي c
- 2021-05-11
- MarwaMohammed
الأجوبة
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
int main()
{
int num, curoot,ans;
printf("\n\n Check whether a number is a perfect cube or not: \n");
printf(" -----------------------------------------------------\n");
printf(" Input a number: ");
scanf("%d",&num);
curoot=round(pow(num, 1.0/3.0));
if(curoot*curoot*curoot==num)
{
printf(" The number is a perfect Cube of %d \n",curoot);
}
else
{
printf(" The number is not a perfect Cube.\n");
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال