question in c

madhu24's Avatar, Join Date: Aug 2009
Newbie Member
hi guys,
can anyone help me in solving this problem as i am new to c programming ,
write a program to find the range for the set of numbers using while loop.
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
How much have you progressed in writing this code?
murugaperumal's Avatar, Join Date: Feb 2010
Go4Expert Member
Dear Friend,

You can use the following coding.

Code:
#include<stdio.h>
main()
{
        int a,b;
        printf("Enter the first number\n");
        scanf("%d",&a);
        printf("Enter the second number\n");
        scanf("%d",&b);
        if(b<=a)
        {
                printf("You can't get the range\nThe first number should be less than second number\n");
        }
        while(a<=b)
        {
                printf("%d\t",a);
                a++;
        }
}
abubacker1's Avatar, Join Date: Feb 2010
Light Poster
Did u mean u'll give a sequence of number like 1,2,3,6,7,23, etc and the code need
to find the range of these numbers as 1 to 23 ,

or

U'll give a couple of number the code needs to print the numbers in between them ?

Please solve my confusion