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??
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / xyz
near keyword int there is a colon so isnt tat a compling error
| Is This Answer Correct ? | 0 Yes | 0 No |
How does normalization of huge pointer works?
How do you declare a variable that will hold string values?
main() { float a=3.2e40; printf("%d",a); }
Is javascript written in c?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
explain what is a newline escape sequence?
Is array a primitive data type in c?
explain how do you use macro?
Can you return null in c?
What are operators in c?
Can we increase size of array in c?
What is console in c language?