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 |
Explain how can I open a file so that other programs can update it at the same time?
main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }
Define Spanning-Tree Protocol (STP)
What does typedef struct mean?
What is Lazy evaluation in C? Give an example.
How can you call a function, given its name as a string?
I have an array of 100 elements, each of which is a random integer. I want to know which of the elements: a) are multiples of 2 b) are multiples of 2 AND 5 c) have a remainder of 3 when divided by 7
find largest element in array w/o using sorting techniques.
What are volatile variables?
What is spark map function?
how to find string length wihtout using c function?
develop algorithms to add polynomials (i) in one variable