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
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
Define C in your own Language.
cavium networks written test pattern ..
Why is c not oop?
What does stand for?
Is fortran still used in 2018?
Is c pass by value or reference?
How are strings stored in c?
Why is not a pointer null after calling free?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is wrong in this statement? scanf(ā%dā,whatnumber);
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is atoi and atof in c?
Write a program to find the biggest number of three numbers in c?
What is cohesion and coupling in c?