Input & Output


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main(int argc, char** argv)
    {
    char *str = "Interveiw";
    int n = 3;
    printf("%10.*s", n, str);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Int(note:6 spaces after Int)


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 25, m = 13;
    printf("%d %d %d", n, m);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    25 13 Garbage value



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int m = 31, n = 13, p = 30;
    printf("%d %d ", m, n, p);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    31 13


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    char *str = "Interview";
    int n = 30;
    printf("%*s", n, str);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Interview(note: spaces to the left of Interview)



  1. What is the difference between %e and %g?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    %e always formats in the format [-]m.dddddd or [-]m.dddddE[+|-]xx where no.of ds are optional and output formatting depends on the argument