Elevator_C - proposed_load=total_load wt if(proposed_load<= MAX total_load=proposed_load printf"new =%4 total =%4\n",wt,total_load else

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /* Elevator.C Purpose: To allow individuals to enter an elevator as long as the total weight doesn't exceed a specified maximum. */ #include <stdio.h> #define MAX 500 int main(void) { int total_load=0,wt,proposed_load do { printf("Give new proposed weight: ")
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: proposed_load=total_load+wt if (proposed_load <= MAX) { total_load=proposed_load printf("new = %4 total = %4\n",wt,total_load) } else printf("NOT ALLOWED. This will give a total load of %i.\n", } while (proposed_load < MAX) return 0 }...
View Full Document

This note was uploaded on 04/17/2008 for the course CSCI 1190 taught by Professor Minooaminian during the Spring '08 term at Rensselaer Polytechnic Institute.

Ask a homework question - tutors are online