main()
{
charstr1="prakash";
charstr2="raju";
Str1=str2;
printf("\n%d",str1);
}

Answers were Sorted based on User's Feedback



main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / kk

Error
An array of string cannot be directly assigned to other;
soln: char *str1="prakash"
char *str2="raju"
str1=str2;

Is This Answer Correct ?    17 Yes 2 No

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / naman patidar

compile time error at line 3 and 4.
can not assign string to char ( i.e. to str1 and str2).

Is This Answer Correct ?    14 Yes 3 No

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / app

Error
Since address of different strings are compared

Is This Answer Correct ?    2 Yes 0 No

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / kas

well the program will run finely ... with some warnings
of course ...

This is what I got as "out put" of the program using Fedora13...

Warning: multi-character character constant
In function 'main'
Warning: overflow in implicit constant conversion ...

But the RESULT was given as the ASCII of the last character
of the second string ..
That is in this case the answer will be "117";
Hope it helps ... :D

Is This Answer Correct ?    1 Yes 0 No

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / ashok kumar

error

Is This Answer Correct ?    0 Yes 0 No

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / vignesh1988i

ascii value of 'r' will get printed

Is This Answer Correct ?    0 Yes 6 No

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d&..

Answer / vignesh1988i

may i know the reason for this error

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More Operating Systems General Concepts Interview Questions

How do I dual boot my pc?

0 Answers  


What is basic concept of operating system?

0 Answers  


What are necessary conditions for dead lock?

0 Answers  


Can my processor run 64 bit?

0 Answers  


What are the necessary conditions for deadlock to occur?

0 Answers  






What is a mission critical system?

0 Answers   CSE,


Define latency, transfer and seek time with respect to disk I/O.

2 Answers   Brainware,


What is gang scheduling in operating system (os)?

0 Answers  


What is the difference between Authoritative restore & Non- Authoritative restore?

1 Answers   Wipro,


How you can detect deadlock condition?

0 Answers  


What is the context switch?

0 Answers  


Explain the difference between internal and external fragmentation in memory management. Suggest ways to reduce them.

0 Answers   Agilent, Amdocs,


Categories