What is the output of the program given below

#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

Answers were Sorted based on User's Feedback



What is the output of the program given below #include<stdio.h> main() { ..

Answer / madhu

127.As i is a char the last digit would be 127,so the loop
stops at that point.
I crosschecked it writing a program.

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More C Interview Questions

What are the various topologies? Which one is the most secure?

2 Answers  


Do you know the difference between exit() and _exit() function in c?

0 Answers  


What is the difference between realloc() and free()

1 Answers  


how to return 1000 variables from functio9n in c?plz give me code also

6 Answers  


what do you mean by defining a variable in our c code?

2 Answers  


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

0 Answers  


Tell me about low level programming languages.

0 Answers   Amdocs,


How do you determine the length of a string value that was stored in a variable?

0 Answers  


void main() { int i=5; printf("%d",i+++++i); }

17 Answers   ME,


what is the need for main function in c?

5 Answers  


Q. where is the below variables stored ? - volatile, static, register

3 Answers   Bosch,


What are types of structure?

0 Answers  


Categories