adplus-dvertising
frame-decoration

Question

What is the output of C program?
int main()
{
    char str1[] = "FIRST";
    char str2[20];
    strcpy(str2,str1);
    printf("%s %s ",str1,str2);
    printf("%d", (str1!=str2));
    printf("%d", strcmp(str1,str2));
    return 0;
}

a.

FIRST FIRST 0 0

b.

FIRST FIRST 1 1

c.

FIRST FIRST 10

d.

FIRST FIRST 0 1

Posted under C Programming

Answer: (c).FIRST FIRST 10

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of C program?

Similar Questions

Discover Related MCQs

Q. Choose a correct C statement about String functions?

Q. A C string elements are always stored in

Q. A character constant is enclosed by

Q. What is the ASCII value of NULL or \0?

Q. Choose a correct C Statement about Strings.

Q. How do you accept a Multi Word Input in C Language?

Q. What is the maximum length of a C String?

Q. What is the Format specifier used to print a String or Character array in C Printf or Scanf function?

Q. What is a String in C Language?

Q. What is the correct syntax of enum?

Q. Arithmetic operations are not allowed on enumerated constants.

Q. Pick the incorrect statement with respect to enums.

Q. String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.

Q. All enum constants are

Q. If we do not explicitly assign values to enum names, the compiler by default assigns values to ?

Q. Enumeration (or enum) is a ______ data type in C.

Q. Which of the following gives the memory address of the first element in array foo, an array with 10 elements?

Q. Let x be an array.Which of the following operations is illegal?

i) ++x.
ii) x+1.
iii) x++.
iv) x*2.

Q. Which of the following statements are correct ?

1. A string is a collection of characters terminated by '.
2. The format specifier %s is used to print a string.
3. The length of the string can be obtained by strlen().
4. The pointer CANNOT work on string.

Q. How will you print ' ' on the screen?