What is the output of the program given below

main()

{

signed char i=0;

for(;i>=0;i++) ;

printf("%d\n",i);

}

Answer Posted / susie

Answer :

-128

Explanation

Notice the semicolon at the end of the for loop. THe initial
value of the i is set to 0. The inner loop executes to
increment the value from 0 to 127 (the positive range of
char) and then it rotates to the negative value of -128. The
condition in the for loop fails and so comes out of the for
loop. It prints the current value of i that is -128.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to test pierrot divisor

2365


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

1929


why nlogn is the lower limit of any sort algorithm?

2458


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']

614


How to palindrom string in c language?

9295






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

2974


Design an implement of the inputs functions for event mode

3053


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

2803


What is data _null_? ,Explain with code when u need to use it in data step programming ?

2923


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2130


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2374


Write a routine to implement the polymarker function

4487


write a program for area of circumference of shapes

2134


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

2441


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

3145