Write an algorithm to input a number. Find its square if the entered number is multiple of 10. If entered number if not a multiple of 10, then find its cube
Write the code in C language.
Answers
Answered by
0
Answer:
#include <stdio.h>
int main() {
int num;
printf("Enter a number:");
scanf("%d" , &num);
if(num%10 == 0){
printf("Square of %d is %d",num,(num*num));
}
else{
printf("Cube of %d is %d",num,(num*num*num));
}
return 0;
}
Explanation:
Similar questions