Thread: Skip Instruction

  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    1

    Skip Instruction

    Hello ,
    I wrote a code that reads a variable that has to be superior to 0 and inferior to 9999999 but i want it to start with a 0 for example "05946782" but when i enter such an input it skips to the next instruction where i put another scanf an integer superior to 0 and inferior to 10 with an error message "Invalid" so when i enter as input in the first scanf "09456148" it automatically skips to the next scanf and displays "Invalid"
    so is there a way to not let him do that ?
    Thanks

    https://cboard.cprogramming.com/imag...BJRU5ErkJggg==

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,531
    I think you need to find a better way of posting your code than as a massively long URL containing an image.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help to skip a process
    By denumbaone in forum C++ Programming
    Replies: 1
    Last Post: 02-05-2011, 08:30 PM
  2. Why does it skip a scanf()?
    By homorapian in forum C Programming
    Replies: 3
    Last Post: 10-21-2010, 04:58 AM
  3. What would skip do??
    By swgh in forum Tech Board
    Replies: 2
    Last Post: 08-27-2006, 09:35 AM
  4. Skip the Elections
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 02-12-2005, 07:04 AM
  5. Skip lists
    By Cela in forum C Programming
    Replies: 2
    Last Post: 01-18-2003, 09:39 AM

Tags for this Thread