Answer:
The program written in C language is as follows
#include<stdio.h>
int main()
{
//Declare digit
int digit;
//Prompt user for input
printf("Enter any integer: [10 - 100]: ");
scanf("%d", &digit);
//Check if digit is within range 10 to 100
while(digit<10 || digit >100)
{
printf("Enter any integer: [10 - 100]: ");
scanf("%d", &digit);
}
//Initialize counter to 0
int counter = 0;
for(int i=digit;i>0;i--)
{
printf("%3d", i); //Print individual digit
counter++;
if(counter == 10) //Check if printed digit is up to 10
{
printf("\n"); //If yes, print a new line
counter=0; //And reset counter to 0
}
}
}
Explanation:
int digit; ->This line declares digit as type int
printf("Enter any integer: [10 - 100]: "); -> This line prompts user for input
scanf("%d", &digit);-> The input us saved in digit
while(digit<10 || digit >100) {
printf("Enter any integer: [10 - 100]: ");
scanf("%d", &digit); }
->The above lines checks if input number is between 10 and 100
int counter = 0; -> Declare and set a counter variable to 0
for(int i=digit;i>0;i--){ -> Iterate from user input to 0
printf("%3d", i); -> This line prints individual digits with 3 line spacing
counter++; -> This line increments counter by 1
if(counter == 10){-> This line checks if printed digit is up to 10
printf("\n"); -> If yes, a new line is printed
counter=0;} -> Reset counter to 0
} - > End of iteration