what is the output of the program??
#include<stdio.h>
main ( )
{
int a=010,sum=0,tracker:
for(tracker=0;tracker<=a;tracker++)
sum+=tracker;
printf(ā %d\nā,sum);
}
what is the difference between a=10 and a=010??
Answer Posted / vidyullatha
In linux:
Answer is 36 instead of 55.
i.e the loop iterates till tracker=8 instead of tracker=10.
Thats is because, I guess when u initialise a=010, compiler
takes a = octal 10 i.e in decimal it is 8.
So the loop iterates through tracker<=8.
This is my guess. I am not sure of the real answer.
Please let me know if any one knows the right answer.
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
Can include files be nested? How many levels deep can include files be nested?
Define recursion in c.
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is #define size in c?
What are the different types of errors?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
What's a good way to check for "close enough" floating-point equality?
How can I get the current date or time of day in a c program?
How many types of functions are there in c?
What are the types of pointers in c?
What is the difference between strcpy() and memcpy() function in c programming?
What is ctrl c called?
Why #include is used in c language?
Do string constants represent numerical values?
If you know then define #pragma?