void main()
{
for(int i=0;i<5;i++);
printf("%d",i);
}
What is the output?..
Answers were Sorted based on User's Feedback
Answer / kumaran
declaring int i inside for loop is not available in
traditional 'c'
| Is This Answer Correct ? | 80 Yes | 30 No |
Answer / mahfooz
we can not declare loop condition variable in c..we can do
in c++.
| Is This Answer Correct ? | 38 Yes | 20 No |
Answer / samir isakoski
why shoul have a cout if is c++
buth this is c (printf)
and why cannot daclare a int in the for ciclus
| Is This Answer Correct ? | 17 Yes | 11 No |
Answer / divya
no output because the for loop is terminated with a semicolon which means the loop will terminate at once.
| Is This Answer Correct ? | 15 Yes | 12 No |
Answer / shilpi
it will give 6 as a answer because condition is true inside and then it will increase its value by 1 and the terminate from the loop.
| Is This Answer Correct ? | 2 Yes | 0 No |
hi friend i am ricky dobriyal.
if this programe in c then this program produce error
expression syntex error.
if in c++ then it will produce o/p=5
| Is This Answer Correct ? | 10 Yes | 9 No |
Answer / pramod
if it is in C it displays an error "indicating that "i"
cannot be declared in loop and i as undefined symbol"
if it the case of C++ it displays "5" because C++ supports
dynamic declaration and once declared anywhere in the
program(even in loops) can be used anytime in that program
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / marius
if i have
$x=(11,22,33,44,55);
for($i=0;$i<5;$i++)
echo$x[$i]." ";
and we will print this:
11 22 33 44 55
$i=0 => 11
$i<5 => 44
$i++ => 55
ghigamarius@gmail.com
| Is This Answer Correct ? | 1 Yes | 2 No |
How to upgrade LOOP environment, I just mean, how can i make loop statement editable ? I just try some program using loop statement and checking it in multiple compilers. Every compiler showing different output, what's the wrong ? is it a compiler based problem, or loop based problem, tell me why ? and what will be the debugging process, for this kind of problem ?
Using string functions write a program that will accept the name of the capital as input value and will display the corresponding country. ------------------------ Capitals Countries ------------------------ Capitals Countries Ottawa Canada Moscow Russia Rome Italy I can't not get it to run properly
void main() { int i=7; printf("N= %*d",i,i); }
errors are known as?
3 Answers EX, State Bank Of India SBI,
what is meant by linking error? how can i solve it? if there is a linking error " unable to open file 'cos.obj'? then what should i do?
what is run time error?
how to convert decimal to hexadecimal without using arrays just loops
loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program.
What is the out put of this programme? int a,b,c,d; printf("Enter Number!\n"); scanf("%d",&a); while(a=!0) { printf("Enter numbers/n"); scanf("%d%d%d",&b,&c,&d); a=a*b*c*d; } printf("thanks!"); getche(); Entering numbers are a=1,b=2,c=3,d=4 b=3,c=4,d=-5 b=3,c=4,d=0
To generate the series 1+3+5+7+... using C program
full c programming error question based problem
Display this kind of output on screen. 1 0 1 1 0 1 3. Display this kind of output on screen. 1 1 0 1 0 1 4. Display this kind of output on screen. 1 1 0 1 0 1 5.Display this kind of output on screen. 1 2 3 4 5 6 7 8 9 10