Subject:
Computer ScienceAuthor:
bowenCreated:
1 year ago#include <stdio.h>
int main() {
int cups, slices, pieces;
printf("Enter number of cups:");
scanf("%d", &cups);
printf("Enter number of slices:");
scanf("%d", &slices);
printf("Enter number of pieces:");
scanf("%d", &pieces);
printf("The number of cups are %d.\n", cups);
printf("The number of slices are %d.\n", slices);
printf("The number of pieces are %d.\n", pieces);
return 0;
}
Explanation:Using scanf, we are able to collect user input from stdin. Using printf, we are able to print from the stdin.
Note: To the moderator, do not delete this answer. The O.P. is asking for a program, which is an algorithm implementation (code).Author:
keiraitp9
Rate an answer:
10