Multiple User Input from single scanf

Discussion in 'C' started by usama_muneeb, Jun 19, 2008.

  1. usama_muneeb

    usama_muneeb Banned

    Joined:
    Mar 7, 2008
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    How do we get multiple user input in a single scanf. Is it OK:

    Code:
    scanf("%f %d", &a, &b);
    ?

    Also, using a switch statement, is it possible to enter all statements in braces except break?

    e.g.

    Code:
    switch ( operator ) {
           case 'S':
           {
           statement;
           statement;
           }
           break;
    }
    
    ?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice