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 / vera
012345
not
0
1
2
3
4
cz their is no printf("\n");
first time i=0 it print 0
scnd time i=1 it print 1
last time i=4 it print 4
but not 5 cz when i=5 :i is not <5
so it will not print 5
10x
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / sanjeevi
Guys remember things
1) we cant declare loop variable inside for
2) here i is local to for loop alone..
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / chuimaya
It gives an error coz we cannot declare a variable inside the for loop.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / ramveer
for the first loop i is 0 so 0 is printed
for 2nd time i++ i becomes 1 so 1 is printed
for 3rd time i becomes 2 so 2 gets printed
for 4th time i becomes 3 so it gets prited
for 5th time i becomes 4 so it gets printed
now for this time i has became 5 and this isn't in loop boudary as the condition is i<5 so its breaks out of loop.
so the ans is "0 1 2 3 4" .
| Is This Answer Correct ? | 9 Yes | 10 No |
Answer / erdem
Ofcourse
01234
(logic for start from 0 to 4 and no blank or tab)
| Is This Answer Correct ? | 1 Yes | 2 No |
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
To generate the series 1+3+5+7+... using C program
write a profram for selection sort whats the error in it?
Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor's notes: This problem requires either a while or a do-while loop.
I'm having trouble with coming up with the correct code. Do I need to put a loop? Please let me know if I'm on the right track and what areas I need to correct. I still don't have a good grasp on this programming stuff. Thanks =) The assignment was to write a program using string functions that accepts a coded value of an item and displays its equivalent tag price. The base of the keys: 0 1 2 3 4 5 6 7 8 9 X C O M P U T E R S Sample I/O Dialogue: Enter coded value: TR.XX Tag Price : 68.00
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
full c programming error question based problem
wap for bubble sort
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
Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.
Declaration of Cube Guys please help me.. Is this a right way to declare cube.? If i Compile it. It Says: Cube undeclared what should i do? Please help \thanks in advanced #include<stdio.h> #include<math.h> #include<conio.h> main( ) { float x,y; while(x++<10.0) { printf("Enter Number:"); scanf("%d", &x); y = cube(x); printf("%f %f %f \n", x,pow(x,2),y); cube(x); } { float x; float y; y = x*x*x; } getch(); return (y); }
#include<>stdio.h> #include<>conio.h> { printf("hello"); void main() getch(); } what the out put of this program and why ......plz clear my answer