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  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
main()
      {	
      char a[4]="HELL";
      printf("%s",a);
      }
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { char a[4]="HELL"; printf("%s",a); }
Answer
# 1
Answer :
HELL%@!~@!@???@~~!

      Explanation:
The character array has the memory just enough to hold the
string “HELL” and doesnt have enough space to store the
terminating null character. So it prints the HELL correctly
and continues to print garbage values till it 	accidentally
comes across a NULL character.
 
Is This Answer Correct ?    7 Yes 3 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
why java is platform independent? Wipro10
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }  1
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped IBM1
Program to find the largest sum of contiguous integers in the array. O(n)  7
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }  1
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }  1
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }  1
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }  1
Print an integer using only putchar. Try doing it without using extra storage.  1
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }  1
main() { 41printf("%p",main); }8  1
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }  1
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }  1
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above HCL1
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes. Aricent7
main() { int i=400,j=300; printf("%d..%d"); }  1
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }  1
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }  1
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); } TCS2
how to delete an element in an array  1
 
For more C Code 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