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 |
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,
Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
write a c program, using for loop, that accepts and odds two numbers. The output must be the sum and the addens. This should be repeated 5 times while the first number is decremented by one and the second number is incremented by 1.
write a function -oriented program that generates the Fibonacci, the current numbers of n(as input) and display them (series). In Fibonacci, the current third number is the sum of the previous number.
using friend function find the maximum number from given two numbers from two different classes.write all necessary functions and constructor for the classes.
Algorithm in O(2n) Presently we can solve in our hypothetical machine problem instances of size 100 in 1 minute using algorithm A, which is a O(2n). We would like to solve instances of size 200 in 1 minute using algorithm A on a new machine. What is the speed of the new machine should be?
2 Answers ABC, Qatar 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.
How reader and writer problem was implemented and come up with effective solution for reader and writer problem in case we have n readers and 1 writer.
1. Write a program using one dimensional array that calculates the sum and average of the five input values from the keyboard and prints the calculated sum and average.
Seat Reservation prog for the theatre. Write a function for seat allocation for the movie tickets. Total no of seats available are 200. 20 in each row. Each row is referred by the Character, "A" for the first row and 'J' for the last. And each seat in a row is represented by the no. 1-20. So seat in diffrent rows would be represented as A1,A2....;B1,B2.....;........J1,J2... Each cell in the table represent either 0 or 1. 0 rep would seat is available , 1 would represent seat is reserved. Booking should start from the last row (J) to the first row(A). At the max 20 seats can be booked at a time. if seats are available, then print all the seat nos like "B2" i.e (2 row, 3 col) otherwise Print "Seats are not available." and we must book consecutive seats only.
can we declare an object of a class in another class?(assume both class as public classes)