answersLogoWhite

0


Best Answer

What is the output for the following C program?

include<stdio.h>

int main (void) {

char* str1 = "Hello world";

char str2[] = "Hello world";

printf ("%d, %d, %d, %d\n", sizeof(str1), sizeof(str2), strlen(str1), strlen(str2));

return 0;

}

Assuming sizeof (char*) is 4 bytes (implementation-defined) the output will be:

4, 13, 12, 12

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the output for the following C program include include void main(void) char str1 Hello world char str2 Hello world printf (d d d d sizeof(str1) sizeof(str2)strlen(str1) strlen(str2))?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions