ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
main()
{
printf(5+"good morning");
printf("%c","abcdefgh"[4]);
}the o/p is morning and e...how someone explain
 Question Submitted By :: Geetha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { printf(5+"good morning"); printf("%c","abcdefgh"[4]); }the o/p is morning and e...how someone explain
Answer
# 1
the o/p depends upon the compiler and cant be predicted 
wat's hapenning inside .... each will have different 
opinion.....my opinion is :
here in the first printf statement "good morning" acts as 
an string  and 5+"good morning" means print the string 
after the 5th character in the string starting from 0....
so o/p is :
morning

for second one :

this printf can be re-written as the first printf statement
printf("%c",4+"abcdefgh");
here only the 4th character will get printed ... in this 
case it will print 'e'..

thank u
 
Is This Answer Correct ?    2 Yes 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed. Scientific-Atlanta2
2)#include<iostream.h> main() { printf("Hello World"); } the program prints Hello World without changing main() the o/p should be intialisation Hello World Desruct the changes should be a)iostream operator<<(iostream os, char*s) os<<'intialisation'<<(Hello World)<<Destruct b) c) d)none of the above Siemens4
HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE  2
main is a predefined or user define function if user defined why? if predefined whay? TCS2
write a programe returns the number of times the character appears in the string  1
main() { clrscr(); } clrscr(); ME3
void main() { int i=5; printf("%d",i++ + ++i); } ME11
Is the following code legal? struct a { int x; struct a b; }  3
What is the memory allocated by the following definition ? int (*x)[10]; ADITI3
What are volatile variables?  1
what is the function of .h in #include<stdio.h> in c ? IBM9
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value TCS3
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program TCS12
HOW DO YOU HANDLE EXCEPTIONS IN C? AppLabs2
Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?  2
create an SINGLE LINKED LISTS and reverse the data in the lists completely  3
What does a run-time "null pointer assignment" error mean?  2
Program to write some contents into a file using file operations with proper error messages.  1
Program to display given 3 integers in ascending order N-Tech1
What is alloca() and why is its use discouraged?  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com