Look at the Code:
#include<string.h>
void main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
}
What will be the output?
A)No output B) A Non Integer C)0 D) Garbage
Answer Posted / vikram
the question is not correctly written;
undefined ctrcpy,no commas,no header file stdio.h;
if it is correctly written,then the output will be 0 since
the strings efghabcd match and we know that strcmp returns 0
if the two strings match
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can we initialize extern variable in c?
What are the advantages of using new operator as compared to the function malloc ()?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
Explain what are multibyte characters?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is the use of #define preprocessor in c?
Was 2000 a leap year?
Explain about C function prototype?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is the difference between array and pointer in c?
What are the data types present in c?
What is int main () in c?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
What is %lu in c?
a value that does not change during program execution a) variabe b) argument c) parameter d) none