Advertisements

Search results for scanf

Example:[1]

            What will be error the following program will face during execution?
#include <stdio.h>
int main()
{
    char i[5] = "";
    scanf("%s", i);
    printf("%s",i);
    return 0;
}
          
Option A:

            Buffer overflow
            
Option B:

            Heap overflow
            
Option C:

            Frozen memory
            
Option D:

            Memory leak
            
Correct Answer: option A

 Search Links


 Popular C search MCQs


 Popular C search examples