What will be the output-
for(i=1;i<=3;i++)
{
printf("%d",i);
continue;
i++;
}
Answers were Sorted based on User's Feedback
Answer / gourab
the o/p will be 123
bcz after printing 1 for d first time then continue will
take to the for statement.thus i will take value 3.and i++
after d continue statement will never get executed,but it
will not give an error.
| Is This Answer Correct ? | 32 Yes | 2 No |
Answer / chetan
This will not result in a Compiler-error, because "Unreachable-code" is a warning in C, not a compilation error.
The output will be:
123
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / harshit
This will result in compiler error as the code i++; inside
the for loop is not reachable.
If continue statement is enclosed within an if construct
then only the program will compile.
| Is This Answer Correct ? | 14 Yes | 13 No |
It will results in a compile time error, stating that
unreachable code for the second increment statement(i++) after
continue statement.
| Is This Answer Correct ? | 11 Yes | 10 No |
Answer / sakshi arora
The output will be : 123
bcozZ unreachable code is a warning in c , not a compilation error..
| Is This Answer Correct ? | 1 Yes | 0 No |
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
how to take time as input in the format (12:02:13) from user so that controls remains between these columns?
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
0 Answers Jomo Kenyatta University,
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
Hello, I am trying to write a program in c++ which accepts month and year from the user and prints the calender. So please tell me the algorithm and what is the calender logic.
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
. Remove all the blank spaces between character.Matrix is of 10* 10. eg: INPUT ------------------------------------ | N | A | | V | |T ------------------------------------- | |G | U | |P | -------------------------------------- |T | | | A | | ------------------------------------ OUTPUT: ------------------------------------ | N | A | V | T | | ------------------------------------- |G |U | P | | | -------------------------------------- |T | A | | | | ------------------------------------
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
Faster Computers Suppose you have a computer that requires 1 minute to solve problem instances of size 1000. What instance sizes can be run in 1 minute if you buy a new computer that runs 1000 times faster than the old one, assuming the following time complexities T(n) for our algorithm? (a) T(n) = O(n). (b) T(n) = O(n3). (c) T(n) = O(10n).
3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...
What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }