[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 :: String - Discussion

Home > C Programming > String > MCQs Questions Discussion

23 / 26

What is the output of the following 'C' program ?

#include<stdio.h>
int main()
 {
  char a[] = "world";
  printf("%d  %d\n",strlen(a),sizeof(a));
  return 0;
 }

A5,5

B6,5

C5,6

D6,6

Answer: Option (Login/Signup)

Show Explanation

Next, sizeof() operator is used which prints the no. of characters in the character arrar + the '\0' (termination) character, here which is equal to 6.

Hence, the output is 5,6.

Asked In :: Global Edge

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here