freelanceprogrammers.org Forum Index » C
Solve this Query.....
Joined: 01 Feb 2005
Posts: 2
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
thanks.....
Joined: 03 Feb 2005
Posts: 1
Solve this Query.....
Hi Krishna
this sign (-) can be printed by changing "i--" in the loop to "i++".
So, this will be the final code..........
main()
{
int i,n=20;
for(i=0;i<n;i++)
{
cout<<"-";
}
}
jasmeet
--- In Programmers-Town@yahoogroups.com, "krishna_sicsr"
<krishna_sicsr@y...> wrote:
>
>
> 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
>
> thanks.....
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
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
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







