What are you going to see if you run this code and want to enter the mentioned values? (Write everything that is printed and entered)
#include <stdio.h> int main() {
int height, width, depth;
printf(“Enter the height:”); scanf(“%d", &height);
printf(“\nEnter the width:”); scanf(“%d", & width);
printf(“\nEnter the depth:”); scanf(“%d", & depth);
printf("The volume is: %d", height*width*depth); }
My attempt: when I run this code, it simply gives me an error. I am not sure what to do then. Any help would be appreciated. This is how I tried inputting it along with many other ways.
#include <stdio.h> int main() {
int height, width, depth;
int height=10
int width=4
int depth=5
printf(“height:”); scanf(“%d", &height);
printf(“\nwidth:”); scanf(“%d", & width);
printf(“\ndepth:”); scanf(“%d", & depth);
printf("The volume is: %d", height*width*depth);
}
This post has been edited by Skydiver: 29 September 2015 - 07:04 PM
Reason for edit:: Put code in code tags. Learn to do this yourself.

New Topic/Question
Reply


MultiQuote



|