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 |
1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)
how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .
How can I call a function, given its name as a string?
application of static variables in real time
can anyone please tell about the nested interrupts?
What oops means?
c program to compute AREA under integral
can we write a c program with out using main
how we do lcm of two no using c simple if while or for statement
how can u print a message without using any library function in c
What does sizeof return c?
what is the difference between #include<stdio.h> and #include "stdio.h" ?