Input & Output


  1. What does the following command line signify?
    prog1|prog2











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    It runs both the programs, pipes output of prog1 to input of prog2


  1. For a typical program, the input is taken using _________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    For a typical program, the input is taken using Files, Command-line and scanf.



  1. Which among the following is the odd one out?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    scanf


  1. What will be the output of the following C code?
    #include <stdio.h>
    #include <string.h>
    int main()
    {
    char line[];
    fgets(line, 25, stdin);
    printf("%d\n", strlen(line));
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Compilation Error

    main.c: In function ‘main’:
    main.c:5:14: error: array size missing in ‘line’
    char line[];



  1. gets() and puts() operate on ___________











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    stdin and stdout