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   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  ERRORS  >>  C C++ Errors
 
 


 

 
 C C++ Errors interview questions  C C++ Errors Interview Questions
 DotNet Errors interview questions  DotNet Errors Interview Questions
 Database Errors interview questions  Database Errors Interview Questions
 Scripts Errors interview questions  Scripts Errors Interview Questions
Question
main()
{
  char c;
  for(c='A';c<='Z';c++)
getch();
}
 Question Submitted By :: Satrughna Sethi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 1
NO ERRORS but result...........
 
Is This Answer Correct ?    5 Yes 3 No
Ravi
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 2
if ther s no body for the 'for' loop,it should end with 
semicolon..(i.e)
main()
{
  char c;
  for(c='A';c<='Z';c++);
getch();
}
or
main()
{
  char c;
  for(c='A';c<='Z';c++)
   {}
getch();
}
 
Is This Answer Correct ?    4 Yes 9 No
Bharghavi
 
 
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 3
in this question whenever the loop excuted getch() take 
input after that next loop is excuted and similar getch() 
take another input 
that think do untill the conditions of c<='z' is not 
completed
 
Is This Answer Correct ?    2 Yes 2 No
Rakesh
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 4
God help those who help themselves!
try it ur's self because i don't know about this programming
brother! i'm sorry forgive me.
 
Is This Answer Correct ?    1 Yes 2 No
Carlos
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 5
The initial condition is c='A'.
Here the the statement "getch();" is the body of the loop.
it is executed once and c becomes 'B' and again the loop is
executed.
This is done,I mean the loop is executed 26 times.
when c become 'Z' the loop is executed one more time(because
the condition is c<='Z')and then the program exit.
 
Is This Answer Correct ?    1 Yes 1 No
Sujeesh Krishnan
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 6
this wont show any errors since syntactically it is correct...
but since there is no instructions after for loop for operations unfortunelety getch() will be taken as the next instruction , and thus compiler system will be under ambiquity. since the character key pressed will be taken as the value of getch() so that will say to the OPERATING SYSTEM that compilation has got over and it will return to the IDE... but for loop has not got over.. so this depends on the compilers usage............



thank u
 
Is This Answer Correct ?    0 Yes 0 No
Vignesh1988i
 
  Re: main() { char c; for(c='A';c<='Z';c++) getch(); }
Answer
# 7
No Errors
loop will execute for 26 times,each time it will wait for an
input and finally terminate when c becomes > Z.
 
Is This Answer Correct ?    1 Yes 0 No
Aaaaaaa
 

 
 
 
Other C C++ Errors Interview Questions
 
  Question Asked @ Answers
 
To generate the series 1+3+5+7+... using C program  5
main() { char c; for(c='A';c<='Z';c++) getch(); }  7
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;  3
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....  3
how to convert decimal to binary in c using while loop without using array  7
Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it.  1
loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program. CMC4
void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?  10
void main() { for(int i=0;i<5;i++); printf("%d",i); } What is the output?..  6
write a profram for selection sort whats the error in it?  1
wap for bubble sort  2
who was the present cheif governor of reserve bank of india SBI3
Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor's notes: This problem requires either a while or a do-while loop.  1
printy(a=3,a=2)  3
Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .  1
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a do...while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total . Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total . Use no variables other than n , k , and total .  3
 
For more C C++ Errors 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