What is the output of the program given below
#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Answer Posted / sharan
#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
Here the CATCH is semicolon after for
so maximum positive value for the signed char is 127.
Hence it loops 127 times after that value of i wraps to
negative value that is -128.
Thus it prints -128.
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What do you mean by a local block?
How can you invoke another program from within a C program?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is void c?
How do we make a global variable accessible across files? Explain the extern keyword?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Does c have an equivalent to pascals with statement?
Explain how do you sort filenames in a directory?
What are lookup tables in c?
What is %d used for?
how could explain about job profile
What is a function simple definition?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What does *p++ do?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none