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

what will happen if you executed this code?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a constant?

829


What do you mean by command line argument?

853


Explain what are compound statements?

829


What is a pointer and how it is initialized?

841


Explain how can a program be made to print the name of a source file where an error occurs?

961


Do you know the purpose of 'register' keyword?

838


In which header file is the null macro defined?

1134


swap 2 numbers without using third variable?

899


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

852


What are the different properties of variable number of arguments?

926


Difference between strcpy() and memcpy() function?

881


How can I read and write comma-delimited text?

862


When can a far pointer be used?

789


Explain the term printf() and scanf() used in c language?

841


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

982