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

Explain the extern storage classes in c++.

1104


When do we run a shell in the unix system? How will you tell which shell you are running?

1023


Explain stl.

1414


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2675


how to making game in c++ ?

2782


Is oop better than procedural?

1088


What is the use of lambda in c++?

1078


Can you use the function fprintf() to display the output on the screen?

1294


What are oops functions?

1076


What is difference between oop and pop?

1237


What is the use of 'using' declaration in c++?

1190


What are literals in C++?

1077


Why oops is important?

1193


What is operators in c++?

1053


Write about the role of c++ in the tradeoff of safety vs. Usability?

1126