Answer to Question #280142 in C for teheee

Question #280142

I wanna experiment on looping through a range of numbers that will be randomly inputted by the user. However, I don't want to let them see the loading percentage that is divisible by 4, so please exclude those for me when printing it out.

Thank you!


Instructions:

  1. Input two integers in one line. The first inputted integer will be the starting point, and the second one shall serve as the ending point.
  2. Use the power of loops to loop through the starting point until the ending point (inclusive), and print out each number within the range with the corresponding format shown on the sample output.
  3. However, skip the printing of statement if the integer is divisible by 4.
  4. Tip: Utilize the continue keyword to complete the process.
1
Expert's answer
2021-12-17T06:51:58-0500


#include <stdio.h>
#include <string.h>
#include <ctype.h>


int main(){
	int  startingPoint,secondPoint;
	//Input two integers in one line. The first inputted integer will be the starting point, and the second one shall serve as the ending point.
	scanf("%d%d",&startingPoint,&secondPoint);
	
	//Use the power of loops to loop through the starting point until the ending point (inclusive), and print out each number within the range with the corresponding format shown on the sample output.
	for(int i=startingPoint;i<=secondPoint;i++){
		//However, skip the printing of statement if the integer is divisible by 4.
		if (i % 4 == 0){
			continue;
		}
		printf("Loading...%d%\n",i);
	}




	getchar();
	getchar();
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS