If Statements - printf"Invalid\n" Nested if...

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

View Full Document Right Arrow Icon
/* This program demonstrates if statements */ #include <stdio.h> void main() { int test; printf("Enter your test score "); scanf("%d",&test); printf("Great\n"); printf("Ok\n"); printf("Passable\n"); printf("Stupid\n"); if(test <0 || test >100)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("Invalid\n"); /* Nested if example if(test<0 || test>100) printf("Invalid\n"); else if(test>=90) printf("Great\n"); else if(test>=70) printf("Ok\n"); else if(test>=50) printf("Passable\n"); else printf("Stupid\n"); */ } /* Enter your test score 90 Great Press any key to continue . . . */...
View Full Document

This note was uploaded on 10/05/2011 for the course CS 36 taught by Professor Sethhochwald during the Spring '09 term at Irvine Valley College.

Ask a homework question - tutors are online