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

When would you choose to return an error code rather than throw an exception?

0 Answers   Amazon,


Consider the following C++ program

0 Answers  


C++ Public access specifier instead of Private – What is bad ?

0 Answers  


Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.

1 Answers  


what is a pragma in C++?

0 Answers   Aspire,


Difference between Call by pointer and by reference.

0 Answers   Adobe,


What Is A Conversion Constructor C++ ?

0 Answers   Amazon,


Write a C++ Program to Display Number (Entered by the User).

1 Answers  


Can we provide one default constructor for our class?

0 Answers  


Write a C++ Program to find Addition of Two Numbers.

1 Answers  


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

0 Answers   Accenture,


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

0 Answers   Alter,


Categories