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

Write a Program to find whether the given number or string is palindrome.

0 Answers   InterGraph,


Explain function pointer with exapmles.

2 Answers  


Write a simple code fragment that will check if a number is positive or negative.

0 Answers  


Tell me the use of bit field in c language?

0 Answers  


wat is the output #define VOLEDEMORT _who_must_not_be_named int main() { printf("VOLEDEMORT"); }

2 Answers  






what is the need for main function in c?

5 Answers  


List a few unconditional control statement in c.

0 Answers  


What is the use of f in c?

0 Answers  


What is the difference between pure virtual function and virtual function?

0 Answers  


What is sizeof array in c?

0 Answers  


int *a[5] refers to

12 Answers   TCS,


Can you write the algorithm for Queue?

0 Answers   College School Exams Tests, TCS,


Categories