Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   question in c (http://www.go4expert.com/forums/question-in-c-t20165/)

madhu24 22Nov2009 22:49

question in c
 
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 23Nov2009 08:54

Re: question in c
 
How much have you progressed in writing this code?

murugaperumal 26Feb2010 11:46

Re: question in c
 
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 26Feb2010 12:36

Re: question in c
 
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


All times are GMT +5.5. The time now is 13:27.