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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
void main()

      {

      char ch;

      for(ch=0;ch<=127;ch++)

      printf(“%c   %d \n“, ch, ch);

      }
 Question Submitted By :: Susie
I also faced this Question!!     Rank Answer Posted By  
 
  Re: void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }
Answer
# 1
Answer :  

      	Implementaion dependent

      Explanation:

The char type may be signed or unsigned by default. If it is
signed then ch++ is executed after ch reaches 127 and
rotates back to -128. Thus ch is always smaller than 127.
 
Is This Answer Correct ?    0 Yes 0 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }  1
How to return multiple values from a function?  4
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }  1
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }  1
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }  1
Printf can be implemented by using __________ list.  1
main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }  1
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }  1
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.  2
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }  1
main() { int i=10; i=!i>14; Printf ("i=%d",i); }  1
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }  1
main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }  1
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }  1
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16 HCL1
Program to Delete an element from a doubly linked list. Infosys4
void main() { int i=5; printf("%d",i++ + ++i); }  1
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }  1
How to swap two variables, without using third variable ? HCL46
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes. Aricent7
 
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