main()
{
printf(5+"Vidyarthi Computers");
}

Answers were Sorted based on User's Feedback



main() { printf(5+"Vidyarthi Computers"); }..

Answer / sujith

I would rather say

rthi Computers

Reason is printf() takes a pointer to char to print the
string. we said 5+"Vidyarthi Computers" so this is
interpreted as "rthi Computers" becuase we have added 5 to
the base pointer. so it will print only "rthi Computers".

Is This Answer Correct ?    18 Yes 0 No

main() { printf(5+"Vidyarthi Computers"); }..

Answer / devvv

rthi computers

Is This Answer Correct ?    7 Yes 0 No

main() { printf(5+"Vidyarthi Computers"); }..

Answer / vignesh1988i

rthi computers

since this will be taken as a string and 5 is the subscript value and prints the remaining characters from 'r'.

Is This Answer Correct ?    3 Yes 0 No

main() { printf(5+"Vidyarthi Computers"); }..

Answer / shruti

arthi computers..


i think 5 characters is 0 - 5 and not 1- 5...

Is This Answer Correct ?    2 Yes 2 No

main() { printf(5+"Vidyarthi Computers"); }..

Answer / rani

output is


rati Computers

Is This Answer Correct ?    1 Yes 3 No

main() { printf(5+"Vidyarthi Computers"); }..

Answer / vijay

ouptput:-
vidya

Is This Answer Correct ?    1 Yes 11 No

Post New Answer

More C Interview Questions

which types of data structure will i use to convert infix to post fix???

5 Answers   IIT,


Are negative numbers true in c?

0 Answers  


How to print %d in output

6 Answers   Wipro,


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

0 Answers  


Is c compiled or interpreted?

0 Answers  






write a prgram of swapping with 2 valiables

6 Answers  


How to write c functions that modify head pointer of a linked list?

0 Answers  


How can I increase the allowable number of simultaneously open files?

1 Answers   CSC,


What are the different types of C instructions?

0 Answers   InterGraph,


List some basic data types in c?

0 Answers  


Which command is more efficient? *(ptr+1) or ptr[1]

3 Answers  


What is the deal on sprintf_s return value?

0 Answers  


Categories