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

What is a class in C++?

1 Answers   Amazon, TCS, UGC Corporation,


What is an abstract class in C++

0 Answers   SwanSoft Technologies,


what is friend function in C++?

0 Answers   TCS,


Define namespace.

1 Answers  


Explain the difference between C and C++.

1 Answers   Accenture,


Is deconstructor overloading possible? If yes then explain and if no Then why?

1 Answers  


What is data abstraction? How is it implemented in C++?

0 Answers   Amdocs,


What is the difference between Stack and Queue in C++?

0 Answers   Global Logic, iNautix,


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

0 Answers   Adobe,


What is the difference between malloc, calloc and realloc?

0 Answers   Alter,


Explain function prototypes in C++.

0 Answers   Aricent,


What is a COPY CONSTRUCTOR and when is it called?

0 Answers   IBS,


Categories