Can someone help me make a simple looping that will print an output of the following.. I cant make a print out of it Please help me..
5
1
4
2
3
3
2
4
1
5
Thank you so much !
Can someone help me make a simple looping that will print an output of the following.. I cant make a print out of it Please help me..
5
1
4
2
3
3
2
4
1
5
Thank you so much !
Sure - What have you done so far
Fact - Beethoven wrote his first symphony in C
Frankly speaking,
This is what I just have for now =((
Am I doing it right?Code:#include<stdio.h> main() { int n,m; for(n=5;n>=1;n--){ printf("\n%d",n); } getch(); }
I still got 2 more hours before our Final Exam =((
EDIT:
Code:#include<stdio.h> main() { int n,m; for(n=5;n>=1;n--){ if(n==5){ printf("\n%d",n); } if(n==1){ printf("\n%d",n); } } getch(); }
Last edited by chanhalzkie; 11-14-2012 at 08:13 PM.
I am not sure what the significance of the numbers is supposed to be. I suppose putting them in an array would be cheating ...
So this is the end of a C programming class?I still got 2 more hours before our Final Exam...
Fact - Beethoven wrote his first symphony in C
or you can put them in an array and print them, what they rapresent?Code:int i,j; for(i=5,j=1;i>0;i--,j++) printf("%d\n%d\n",i,j);
I don't really think that this exercise may help you to pass an exam 2 hours before it..
Study hard my friend, study hard.I just knew that you can actually print 2 outputs in just 1 printf
Fact - Beethoven wrote his first symphony in C
The printf is not the most interesting thing about that code. The loop arguments are the interesting part.
Again, Thank you so much guys!!