|
CS256 - Principles of Structured Design
Fall 2021
|
Displaying ./code/sternflCode/h5/counting.c
/*
counting.c
We are writing yet another loop:
You will start with a user specified number, then count up by 1 to another
number specified by the user, but there will be a third specified number, where
we are going to skip numbers divisible by this number.
*/
#include <stdio.h>
int main(){
int start, end, skip;//variable declarations
//ask the user where to start
//then put input into variable "start" using scanf
printf("Enter Starting Point: ");
scanf("%d", &start);
///ask user for ending point
//put input into variable "end" using scanf
//printf statement goes here
//scanf statement goes here
//ask user what numbers we're skipping
//put input into variable "skip" using scanf
printf("Skip Numbers divisible by: ");
//scanf statement goes here
//write a for loop
// start the loop at "start"
// loop while i is less than or equal to "end"
// then increment i by 1
//if i mod skip is not zero, print the number
// then print "Done" once finished
printf("Done\n");
return 0;
}
|