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

How will you execute a stack using a priority queue? (Push and pop should be in O (1)).

0 Answers   Adobe,


Define an Abstract class in C++?

0 Answers  


Explain the difference between C and C++.

1 Answers   Accenture,


Write a C++ Program to Find Sum and Average of three numbers.

1 Answers  


What is meant by exit controlled loop?

0 Answers   Adobe,


Do you know about Agilent PRECOMPILERS. ?

0 Answers   Agilent,


What are the major differences between C and C++?

0 Answers   Amazon,


What is static variable and difference between(const char *p,char const *p,const char* const p).

0 Answers   Accenture,


What does it mean to declare a member function as static in C++?

0 Answers   Amazon,


Tell How To Check Whether A Linked List Is Circular ?

1 Answers   IBS, Infosys,


what is a pragma in C++?

0 Answers   Aspire,


Write a program that can take input from 3 to 8 and calculate the average?

0 Answers   Accenture,


Categories