edited by
1,354 views
0 votes
0 votes
static char hello[]='hello';
printf("%s",hello);

The output will be same as-

  1. puts("hello");
  2. puts(hello);
  3. printf("%s", "hello");
  4. puts("hello\n");


Answer is 1,2 and 3.

Can anyone tell what's the problem with 4 option? It is also printing hello.

edited by

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
2
stblue asked Oct 18, 2017
744 views
#include <stdio.h>int main(){ int a[] = {50, 60, 10, 30, 40, 20 }; int *b[] = {a+3, a+4, a, a+2, a+1, a+5 }; int c = b; c++; printf("%u, %u, %u\n", c-b, *...
2 votes
2 votes
1 answer
4