Skip to content

Instantly share code, notes, and snippets.

@jtrent238
Created January 9, 2019 16:54
Show Gist options
  • Save jtrent238/1eb5a092fb767134b8047810a07d4fc0 to your computer and use it in GitHub Desktop.
Save jtrent238/1eb5a092fb767134b8047810a07d4fc0 to your computer and use it in GitHub Desktop.
#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