Print 1
Write a program to print all the numbers between a and b (a and b inclusive) using a for loop.
Input Format:
Input consists of 2 integers. The first integer corresponds to a and the second integer corresponds to b. Assume a>=b.
Output Format:
Refer Sample Input and Output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output:
Enter the value of a
4
Enter the value of b
10
4
5
6
7
8
9
10
Solution:
#include<stdio.h>
int main()
{
int a,b,i;
printf("Enter the value of a");
scanf("%d",&a);
printf("\nEnter the value of b");
scanf("%d",&b);
for(i=a;i<=b;i++)
{
printf("\n%d",i);
}
return 0;
}
thank u for sharing this post Meraki Firewall
ReplyDeleteMeraki Cloud
ReplyDeletethank u for sharing this post Meraki Firewall
Meraki Cloud
https://www.tarsus.today/
ReplyDelete