#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 does double pointer mean in c?

0 Answers  


How can my program discover the complete pathname to the executable from which it was invoked?

0 Answers  


1.find the second maximum in an array? 2.how do you create hash table in c? 3.what is hash collision

9 Answers   HCL, Qualcomm,


What is difference between && and & in c?

0 Answers  


Explain what is the purpose of "extern" keyword in a function declaration?

0 Answers  






What will be the output of the following program #include<stdio.h> void main() { int i=20; i-=i+++++i++; printf("%d",i); }

5 Answers  


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

0 Answers  


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

0 Answers  


can we declare a variable in different scopes with different data types? answer in detail

3 Answers   TCS,


5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer

4 Answers  


what is the advantage of software development

1 Answers  


Can 'this' pointer by used in the constructor?

0 Answers  


Categories