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-;
}
}

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a baller and a reference in C++?

1048


Name the debugging methods that are used to solve problems?

1034


What is c++ in english?

997


What are arrays c++?

1045


Differentiate between an array and a list?

1140


Explain the uses oof nested class?

1089


Explain the difference between c & c++?

1018


What is the history of c++?

996


What are the c++ access specifiers?

1340


What does enum stand for?

1060


Explain the concept of copy constructor?

983


Can create new c++ operators?

959


Why iomanip is used in c++?

1071


What is super in oop?

1087


What are the different types of polymorphism in c++?

1062