I was troubled because, even preparing all chapters from standard C programming books by Kanetakar, Ritchie n Karnighm. I found some confusinmg tricky questions, at one programming contest.. For eg. Objective was “What is sequence point..?”
After googling I got ans in just single click. Here are some links you must try while learing C in deep..
1. C-FAQ.COM
2. TheSCRIPT.COM
3. MSDN
4. GCC-GNU
Archive for the ‘codes’ Category

Sequence point in C
November 15, 2007
I Got puzzled..
September 17, 2007Get puzzled in c:
1. Evaluate expression (7/9*9).
2. float x=sqrt(36.0);
printf(“Value x=%d”,x);
3. for(;;);
4. What is the error here.
void main(){
main:
printf(“Address=%p”,main-main);
}
5. What is the o/p:
void main(){
main:
printf(“Address=%p”,main);
}
6. what is o/p.
void main(){
int a=20,foo(int);
printf(“FOO= %d”,foo(a));
}
int foo(int x){
int p=20,q=30;
(a>10)? return p: return q;
}
Answers I tested:
1. 0.000000
2. 6.000000
3. goes into infinite loop
4. Error:Size of type is unknown or zero.
5. Address: 0291
6. Error: Expression Syntax

Sequence point
September 17, 2007I was troubled because, even preparing all chapters from standard C programming books by Kanetakar, Ritchie n Karnighm. I found some confusinmg tricky questions, at one programming contest at PICT.. For eg. Objective was “What is sequence point..?”
After googling I got ans in just single click.
1. C-FAQ.COM
2. TheSCRIPT.COM
3. MSDN
4. GCC-GNU

Power sequence algorithm
July 17, 2007We know how to calculate square of a number…..
Square(n)=n*n
But this square is nothing but sum of first n odd numbers.
i.e. Square(n) =Sum of first n odd nos.
=1+3+5+….+(2n-1)
This statement indicates that if we have a series of squares like 1,4,9,16,25,.. then the series formed with the consecutive differences is nothing but series of odd numbers.
————————————-
This was just simple explaination. But it is extended to any power of a number. like cube, fourt power etc.
Now we see about cubes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 …
Do the following operations.
1. eliminate the each third number
=>1 2 4 5 7 8 10 11 13 14 16
2. Get the running sum of this series.
=>1 3 7 12 19 27 37 48 61 75 91
3. Now eliminate each second number from this series.
=>1 7 19 37 61 91
4. Find once the running sum of this series.
=> 1 8 27 64 125 216
Isn’t it the series of cubes….Similarly for any power of a number we have to find running sum that number of times eliminating numbers as shown here.
—————————————–
1. Delete each Mth number and find the series of running sum
2. Delete each (M-1)th number and find the running sum.
.
. Delete the each 2nd number and find the running sum
It is a series of power M

Facinating world of mathematics..
June 21, 2007I am trying to solve mathematical problems, puzzles using alogorithms in C..
I found some informative links may be useful for someone studying mathematics for fun
1.MathWorld




