#include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}

what will happen if you executed this code?

Answers were Sorted based on User's Feedback



#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; ..

Answer / guest

error wud pop up because u cannot assign arrats or strings
to one another

Is This Answer Correct ?    5 Yes 0 No

#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; ..

Answer / ramesh

u will get error like incompatible types in assignment

Is This Answer Correct ?    5 Yes 0 No

#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; ..

Answer / mannucse

syste

Is This Answer Correct ?    1 Yes 3 No

#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; ..

Answer / sheetal

error will occur for l-value as left operand should be
pointer instead of array. Since assignment is always done
to pointer.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

What is the return type of sizeof?

0 Answers  


Explain what are multibyte characters?

0 Answers  


any string of bits of length 'n' represents a unique non- negative integer between.............?

2 Answers  


write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.

2 Answers  


int n=1; while(1) { switch(n) { case 1:printf("a"); n++; continue; case 2:printf("b"); n++; continue; default : printf("c"); break; } break; }

1 Answers  






code for concatination of 2 strings with out using library functions?

3 Answers  


What do you mean by keywords in c?

0 Answers  


Why do u use # before include in a C Progam?

9 Answers   IBM,


proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?

7 Answers   Hughes,


Wt are the Buses in C Language

0 Answers   Infosys,


i need all types of question paper releted to "c" and other language.

0 Answers  


What are the different types of linkage exist in c?

0 Answers  


Categories