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 %lu in c?
What is string constants?
What is an endless loop?
what is the meaning of java that is (J A V A) full form of JAVA
71 Answers AKS University, Bhel, BNL, BPO, HCL, Peacecon,
What is difference between constant pointer and constant variable?
Write the control statements in C language
what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }
Write a program in c to replace any vowel in a string with z?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What are signals in C?
What are different storage class specifiers in c?