1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

question in c

Discussion in 'C' started by madhu24, Nov 22, 2009.

  1. madhu24

    madhu24 New Member

    Joined:
    Aug 10, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. venami

    venami New Member

    Joined:
    Dec 26, 2008
    Messages:
    195
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    Software Professional
    Location:
    India, Tamil Nadu, Cuddalore
    Home Page:
    How much have you progressed in writing this code?
     
  3. murugaperumal

    murugaperumal New Member

    Joined:
    Feb 20, 2010
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    0
    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++;
            }
    }
    
    
    
     
  4. abubacker1

    abubacker1 New Member

    Joined:
    Feb 20, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    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
     

Share This Page