Instructions:
Input
1. The starting point
2. The ending point
Output
The first line will contain a message prompt to input the starting point.
The second line will contain a message prompt to input the ending point.
The succeeding lines will contain the appropriate messages.
Enter·the·starting·point:·2
Enter·the·ending·point:·10
Loading...2%
Loading...3%
Loading...5%
Loading...6%
Loading...7%
Loading...9%
Loading...10%
#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;
}
Comments
Leave a comment