This is c program that asks user to print the number on screen. User declares some variables that use to contain the value in it. User also uses the switch statement for this execution. User ask to enter the number and in switch statement user declare for loop i=2 and <20 any number been entered the increment operator will increase i+1. Case 2 has the same condition increment operator will increase the number i+2. And default case will show the message “enter valid number“. Display the result on the screen as output.
This is C program that ask user to print the number on screen.
- Declare the variable.
- Using switch statement along with for loop.
- Display the result on screen.
Here is C source code to print the number on screen. Output of this program shown below.
printf("Enter the Number : ");
printf("enter valid number");