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 |
what is a far pointer
12 Answers ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,
Can true be a variable name in c?
What is the memory allocated by the following definition ? int (*x)[10];
What is structure packing ?
write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.
What happens if you free a pointer twice?
Can stdout be forced to print somewhere other than the screen?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
How can I pad a string to a known length?
What is the difference between break and continue?
regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression
Write c-code for 5+55+555+5555+55555+555555+5555555. Output will be it's answer...