Created
January 9, 2019 16:54
-
-
Save jtrent238/1eb5a092fb767134b8047810a07d4fc0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* | |
This program calculates the amount of pasta to cook, given the | |
number of people eating. | |
Author: Mario Boyardee | |
Date: May 30, 2017 | |
*/ | |
int main(void) { | |
int numPeople; // Number of people that will be eating | |
int totalOuncesPasta; // Total ounces of pasta to serve numPeople | |
// Get number of people | |
printf("Enter number of people: \n"); | |
scanf("%d", &numPeople); | |
// Calculate and print total ounces of pasta | |
totalOuncesPasta = numPeople * 3; // Typical ounces per person | |
printf("Cook %d ounces of pasta.\n", totalOuncesPasta); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment