Huawei
Company
Programming
Program
main()
{
static char i;
for(i=0;i<150;i++)
{
printf("*");
}
}
Read Solution (Total 19)
-
- Infinite times
- 10 years agoHelpfull: Yes(19) No(8)
- Infinte Times.
I have tested.. - 10 years agoHelpfull: Yes(11) No(0)
- it gives error message
because char range is from -128 t0 127 here 150 exceeds the range - 10 years agoHelpfull: Yes(7) No(9)
- print * 150 times
- 10 years agoHelpfull: Yes(5) No(10)
- it prints '*' 127 times.After that the value of is incremented by 1,therefore it tries to become 128,which falls outside the valid char range,so it goes to other side and becomes -128 which would satisfy the condition i
- 10 years agoHelpfull: Yes(5) No(0)
- static char i
initially i=0
then it will print * 150 times because of for loop. - 10 years agoHelpfull: Yes(1) No(7)
- 'i' is a character variable. so we need to assign a value by using (''). It will shows compilation error.
- 10 years agoHelpfull: Yes(1) No(4)
- infinite times............tested
- 9 years agoHelpfull: Yes(1) No(0)
- char range is from -128 t0 127,if put i
- 10 years agoHelpfull: Yes(0) No(0)
- when ever we compile this program it prints
150 times " * " - 9 years agoHelpfull: Yes(0) No(1)
- how infinite times it will print can any body tell me?
- 9 years agoHelpfull: Yes(0) No(0)
- prints * 149 times.
- 9 years agoHelpfull: Yes(0) No(2)
- Infinite Loop
- 9 years agoHelpfull: Yes(0) No(0)
- it gives warning that its out of range
- 9 years agoHelpfull: Yes(0) No(0)
- infinte times
- 9 years agoHelpfull: Yes(0) No(0)
- * will be printed infinite time ...
i have tested this pgm...... - 9 years agoHelpfull: Yes(0) No(0)
- how can u assign numeric value to char
- 9 years agoHelpfull: Yes(0) No(0)
- 150 times * will printed.............i have compile it
- 8 years agoHelpfull: Yes(0) No(0)
- As char "i" is static value of i does change so loop will run infinite times
- 4 years agoHelpfull: Yes(0) No(0)
Huawei Other Question