Input & Output


  1. What is the purpose of sprintf?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    It writes the formatted data into a string


  1. The syntax to print a % using printf statement can be done by ________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    %%



  1. What is the meaning of the following C statement?
    printf(“%10s”, state); 











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Print empty spaces if the string state is less than 10 characters


  1. What are the Properties of first argument of a printf() functions?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    It keeps the record of the types of arguments that will follow



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int num;
    scanf("%d", num);
    printf("%d\n", num);
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Undefined behavior