#include <stdio.h>
#include <stdlib.h>
int main()
{
//temp ,tent ,teep as variables names
int temp, tent,teep,cube;
// prompt the user to enter 3 integers
printf("\nInput the first integer: ");
scanf("%d", &temp);
printf("\nInput the second integer: ");
scanf("%d", &tent);
printf("\nInput the third integer: ");
scanf("%d", &teep);
//The program should compare the integers and display the cube of the smallest.
if ((temp<tent) && (temp<teep)){
cube = temp*temp*temp;
printf("\nThe cube of the smallest number %d .",cube);
}
else if ((tent<temp) && (tent<teep)){
cube = tent*tent*tent;
printf("\nThe cube of the smallest number %d .",cube);
}
else if ((teep<tent) && (teep<temp)){
cube = teep*teep*teep;
printf("\nThe cube of the smallest number %d .",cube);
}
return 0;
}
Comments
Leave a comment