[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Arrays - Discussion

Home > C Programming > Arrays > MCQs Questions Discussion

20 / 55

What will be the output of the program ?

#include<stdio.h>
#include<string.h>
void main()
{
char *p="GOOD";
char a[ ]="GOOD";
printf("\n  sizeof(p)  =  %d,  sizeof(*p)  =  %d,  strlen(p)  =  %d",  sizeof(p), sizeof(*p), strlen(p));
printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); 
}

Asizeof(p) = 4, sizeof(*p) = 1, strlen(p) = 4, sizeof(a) = 5, strlen(a) = 4

Bsizeof(p) = 3, sizeof(*p) = 2, strlen(p) = 4 sizeof(a) = 5, strlen(a) = 2

Csizeof(p) = 2, sizeof(*p) = 1, strlen(p) = 4 sizeof(a) = 5, strlen(a) = 4

DCompilation Error

ENone of these

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here