#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 will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }

2 Answers  


Can one function call another?

0 Answers  


i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k);

8 Answers   HCL,


write a programme that inputs a number by user and gives its multiplication table.

2 Answers  


What is sparse file?

1 Answers  






Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!

1 Answers  


what is the associativity of bitwise OR operator?

1 Answers  


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

0 Answers  


char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)

7 Answers   Mascot,


Why cann't whole array can be passed to function as value.

1 Answers  


Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?

7 Answers  


main() { int a[3][4] ={1,2,3,4,5,6,7,8,9,10,11,12} ; int i, j , k=99 ; for(i=0;i<3;i++) for(j=0;j<4;j++) if(a[i][j] < k) k = a[i][j]; printf("%d", k); }

4 Answers   Wipro, Zoho, Vector,






Categories