freelanceprogrammers.org Forum Index » C

replay to krishna_sicsr" <krishna_sicsr@yahoo.com>


View user's profile Post To page top
vijaykumarbh... Posted: Fri Feb 04, 2005 9:32 am


Joined: 04 Feb 2005

Posts: 2
replay to krishna_sicsr" <krishna_sicsr@yahoo.com>
Message: 3
Date: Tue, 01 Feb 2005 07:09:43 -0000
From: "krishna_sicsr" <krishna_sicsr@...>
Subject: Solve this Query.....



hello friends,
i have a problem that my one friend has given me a statement

main()
{
int i,n=20;
for(i=0;i<n;i--)
{
cout<<"-";
}
}

u have to print this sign (-) 20 times with only one changes in the
above problem

this can be solver as
main()
{
int i,n=20;
for(i=0;-i<n;i--)
{
cout<<"-";
}
}

OR
main()
{
int i,n=20;
for(i=0;i<n;n--)
{
cout<<"-";
}
}
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help