Thread: Why is the output of this loop not showing?

  1. #1
    Registered User
    Join Date
    Feb 2017
    Posts
    4

    Unhappy Why is the output of this loop not showing?

    Code:
    #include<stdio.h>
    
    
    int a;
    int b;
    
    
    int main()
    {
    printf("starting number: \n");
    scanf("%d", &a);
    printf("ending number: \n");
    scanf("%d", &a);
    
    
    while (a < b) 
    {
    a++;
    printf("%08d\n", a);
    }
    
    
    return 0;
    
    
    }
    It shows the first 2 printf's but doesnt show the one inside the while loop

  2. #2
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    Look closely at your second scanf!

  3. #3
    Registered User
    Join Date
    Feb 2017
    Posts
    4
    Thanks, i'm sorry to bother you i just didn't see it

  4. #4
    Registered User
    Join Date
    Feb 2017
    Posts
    4
    How do i mark this as solved?

  5. #5
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    Quote Originally Posted by HaxxorBoy View Post
    How do i mark this as solved?
    There's no way to mark it as solved.

  6. #6
    Registered User
    Join Date
    Feb 2017
    Posts
    4
    Oh ok haha

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Output is showing address instead of value
    By worl4125 in forum C++ Programming
    Replies: 2
    Last Post: 12-07-2013, 08:29 AM
  2. Replies: 5
    Last Post: 10-25-2012, 08:22 PM
  3. Replies: 9
    Last Post: 06-11-2012, 03:45 AM
  4. terminal output not showing output properly
    By stanlvw in forum C Programming
    Replies: 13
    Last Post: 11-19-2007, 10:46 PM
  5. Loop output is not quite what I want
    By Zalbik in forum C++ Programming
    Replies: 17
    Last Post: 10-31-2002, 12:35 PM

Tags for this Thread