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


Please Help Members By Posting Answers For Below Questions

Not all reserved words are written in lowercase. TRUE or FALSE?

719


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

653


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

609


How can I handle floating-point exceptions gracefully?

632


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1248






Write a program to check whether a number is prime or not using c?

571


What are the functions to open and close file in c language?

723


In a switch statement, explain what will happen if a break statement is omitted?

632


Why c language is called c?

567


What are the types of data types and explain?

665


What is a pointer and how it is initialized?

605


How do I swap bytes?

626


What is meant by type specifiers?

658


What is the best way to comment out a section of code that contains comments?

776


What are the types of assignment statements?

626