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

What is #include stdio h?

0 Answers  


write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};

5 Answers  


How can I invoke another program from within a C program?

8 Answers  


how to use showbits function?

2 Answers   Infosys, TATA,


Did c have any year 2000 problems?

0 Answers  






how to generate sparse matrix in c

3 Answers  


Why is conio.h not required when we save a file as .c and use clrscr() or getch() ?

2 Answers  


write a program in c language to print your bio-data on the screen by using functions.

0 Answers  


#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }

7 Answers   HCL,


What are the benefits of organizational structure?

0 Answers  


What is the total generic pointer type?

0 Answers  


how to implement stack operation using singly linked list

2 Answers  


Categories