int main()
{
int c=25,i=5;
do
{
c=c/i;
c=c*i;
printf("%d",c);
}
while(i--);
}
I came across this program when i was attending an aptitude test for HCL, during my college days.
And this is the program that helped me to learn about postfix and prefix.
Hope this might help some of the readers.
thanks.
7 comments:
Superb perusu.. keep up ur good work
~Suresh
Super na!
while(i--) na
o/p
25
24
24
24
24
0
while(--i) na
25
24
24
24
24
Lakshmanan that is wrong answer da,
answer is runtime error.
if ur work out this program means clearly u will get postfix and prefix stuffs.
Great Perusu !!
hi mams i am bhaskar. can u explain about prefix postfix stuff in this..
When I execute,got the Floating Point Exception!!!
Super!
Post a Comment