#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

Can we initialize extern variable in c?

0 Answers  


Explain the difference between exit() and _exit() function?

0 Answers  


develop algorithms to add polynomials (i) in one variable

0 Answers   Ignou, TCS,


What is multidimensional arrays

0 Answers  


Explain enumerated types in c language?

0 Answers  


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

0 Answers  


Can we use any name in place of argv and argc as command line arguments?

0 Answers  


a<<1 is equivalent to a) multiplying by 2 b) dividing by 2 c) adding 2 d)none of the above

2 Answers   HCL, NBN,


What are preprocessor directives?

1 Answers  


can any one tel me wt is the question pattern for NIC exam

0 Answers   NIC,


What is the size of empty structure in c?

0 Answers  


Average of a couple 10 years ago was 25. The average remains same after having a child and twins after 3 years. What is the present age of the first child

10 Answers   IBM, Infosys,


Categories