void main()

{

static int i;

while(i<=10)

(i>2)?i++:i--;

printf(ā€œ%dā€, i);

}

Answer Posted / prashanth

As i is static, it initially stores value 0.
as 0<=10 and in next stmt 0>2 is false so i-- is executed..
the loop continues till i=-32768 and when i=-32768 then
-32768>2 is false so i-- is executed..
As -32768-1 is equal to 32767. so i=32767 now..
while condition fails and it comes out of loop..
so the ans. is 32767.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is full form of PEPSI

2095


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1258


Write a program to model an exploding firecracker in the xy plane using a particle system

3834


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4037


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2525






To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

692


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3037


how to test pierrot divisor

2428


write a simple calculator c program to perform addition, subtraction, mul and div.

3341


Develop a routine to reflect an object about an arbitrarily selected plane

3233


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

3992


Write a routine to implement the polymarker function

4543


Sir... please give some important coding questions asked by product companies..

1990


write a program for area of circumference of shapes

2193


A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply. Sample output: Movie Seats Reservation Summary of Seats: Seat 1: Available Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 6 The Seat no. is out of range! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 The Seat no. is already reserved! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 0 GoodBye... Thank You!!!

2038