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
Unsigned char c;
     for ( c=0;c!=256;c++2)
     printf("%d",c);

     No. of times the loop is executed ? 
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?
Answer
# 1
First of all the code returns compile time error....bcoz 
of "c++2",and c!=256 becoz unsigned char takes just 255 
bytes..........and exceeding that results in compile time 
error........
 
Is This Answer Correct ?    0 Yes 2 No
Sundeep
 
  Re: Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?
Answer
# 2
instead of "c++2" if there is "c++" it will not give any 
errors. output will be continuosly for infinite number of 
times.
 
Is This Answer Correct ?    3 Yes 0 No
Subbu
 
 
 
  Re: Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?
Answer
# 3
This will be an infinite loop as the value of unsigned char 
cannot exceed 255....c++2 can be errornous..but the value 
of unsigned char cannot go beyond 255
 
Is This Answer Correct ?    1 Yes 0 No
Shalabh
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is the diffences between Windows XP and Windows Visa Aricent1
How can I set an array's size at run time?  7
Write a program to interchange two variables without using the third variable? Accenture11
Write a program to generate prime factors of a given integer?  1
Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ? Mascot3
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y TCS3
Why data types in all programming languages have some range? Why ritche have disigned first time likethat?Why not a single data type can support all other types? Excel1
why i join syntel? Syntel12
main() { char *p; p="Hello"; printf("%c\n",*&*p); } ME2
swap two integer variables without using a third temporary variable?  2
write a c program to print the values in words eg:- 143 written it has (one hundred and forty three)& 104, 114 are also written words  1
int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p? Verifone6
what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; } Satyam3
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?  3
What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?  1
what is the use of a array in c  4
What is the difference between constant pointer and pointer to a constant. Give examples. TCS4
wite a programme in c to linear search a data using flag and without using flags? TCS3
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?  5
how to find out the reverse number of a digit if it is input through the keyboard?  2
 
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