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

While compiling a c program,graphics header files are not including in my program..eg: <graphics.h>,what may be the problem...is there any environment settings exists.

2 Answers  


Reverse the bit order in a single macro. eg. i/p = 10010101 --> o/p = 10101001

2 Answers  


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

0 Answers  


how to find the sizof of any datatype using bit manipulations

3 Answers  


main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

4 Answers  






union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }

3 Answers  


What will be the output of x++ + ++x?

20 Answers   MBT, Religare,


How can I read a binary data file properly?

0 Answers  


Which header file is essential for using strcmp function?

0 Answers  


main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }

1 Answers   Vector,


Write a code to determine the total number of stops an elevator would take to serve N number of people.

0 Answers   Expedia,


What are the different types of pointers used in c language?

0 Answers  


Categories