Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Identify the errors in the following program.
#include <iostream>
using namespace std;
void main()
{
int i=5;
while(i)
{
switch(i)
{
default:
case 4:
case 5:
break;
case 1:
continue;
case 2:
case 3:
break;
}
i-;
}
}



Identify the errors in the following program. #include <iostream> using namespace std; vo..

Answer / hr

case 1 :
continue;
The above code will cause the following situation:
Program will be continuing while value of i is 1 and value of i is updating. So infinite loop will be created.
Correction: At last line i- should be changed as i–;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

Define type casting in C++.

0 Answers   Amdocs,


Find the Factorial of a number using a program.

0 Answers   Accenture,


How to reverse a string in C++

0 Answers  


What is the 4 difference between delete[] and delete?

0 Answers   Alter,


What is C++11?

1 Answers   Adobe,


What is the meaning of the following declaration: int *const *const *i?

0 Answers   Adobe,


What is the difference between public, private, and protected inheritance?

0 Answers   Amazon,


Explain the importance of method overloading in C++?

0 Answers   Akamai Technologies, Infogain,


What is the difference between creating an object, using 'new' and using 'malloc'?

3 Answers   HFG, Siemens,


What is Boyce Codd Normal form?

0 Answers   IBS,


Tell me about virtual function

1 Answers  


How does stack look in function calls? When does stack overflow? What can you do to remedy it?

0 Answers   Adobe,


Categories