chapter 4 exercise 5 - printf("Multiples of 6 or...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /* * chp4ex4.c * This program displays multiples of 6 or 7. */ //include default material #include <stdio.h> #include "genlib.h" #include "simpio.h" int main() { int HighestAmountOfMultiples int countNumbers = 0 printf("This program displays multiples of 6 or 7 but not both.\n") printf("How high should we go? ") HighestAmountOfMultiples = GetInteger()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("Multiples of 6 or 7:\n") for(int Multiples=1 Multiples<HighestAmountOfMultiples if(Multiples%6==0 || Multiples%7==0){ if(Multiples%6==0 && Multiples%7==0) {}else{ printf("%4.d", Multiples) countNumbers++ if(countNumbers == 5){ printf("\n") countNumbers = 0 } } } } } Sheet1 Page 2 Multiples++){...
View Full Document

This homework help was uploaded on 04/18/2008 for the course CS 120 taught by Professor Towell during the Spring '08 term at Abilene Christian University.

Page1 / 2

chapter 4 exercise 5 - printf("Multiples of 6 or...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online