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 name mangling/name decoration?

0 Answers   Amazon,


What are the fundamental features of an object-oriented language?

0 Answers   Accenture,


Factory Method C++ – How to delete pointers returned by it

0 Answers  


Write a program to display the following output using a single cout statement Maths=90 Physics=77 Chemistry = 69

2 Answers  


What are pass by value and pass by reference?what is the disadvantage of pass by value?

0 Answers   Alter,


what do you mean by exception handling in C++?

0 Answers   Alter,


Define type casting in C++.

0 Answers   Amdocs,


What is Copy Constructor?

5 Answers   ABC, Siemens,


There is a base class sub, with a member function fnsub(). There are two classes super1 and super2 which are sub classes of the base class sub.if and pointer object is created of the class sub which points to any of the two classes super1 and super2, if fnsub() is called which one will be inoked?

0 Answers   Alter,


Explain about Searching and sorting algorithms with complexities

0 Answers   Accenture,


Explain why C++ is not purely Object Oriented Language

0 Answers   Aspire,


Write a program to generate the Fibonocci Series in C++.

0 Answers   Accenture,


Categories