Hey guys, can you help me with this? C programming major in Turbo c. LOL
Well, this is my problem.
Create a program that accepts 10 positive integers. The program will group and sort all even and odd numbers. Even numbers will be sorted in ascending while odd numbers will be sorted in descending order. If theres is no even numbers found the program will print "NO even numbers" yet it prints the odd numbers, and sort it vice versa.
Use if statements or loops only.(turbo c)(no arrays or gotoxy() ]
please do help me.....
SAMPLE OUTPUT 1:
Enter 10 integers: 1 2 3 4 5 6 7 8 9 10
DISPLAYS:
even numbers:
+--------------------------+
| 2 4 6 8 10 |
+--------------------------+
odd numbers:
+---------------------------+
| 1 3 5 7 9 |
+---------------------------+
sorted even numbers:
+---------------------------+
| 2 4 6 8 10 |
+---------------------------+
sorted odd numbers:
+---------------------------+
| 9 7 5 3 1 |
+---------------------------+
SAMPLE OUTPUT 2:
ENTER TEN INTEGERS: 2 4 6 8 10 24 12 26 56 90
DISPLAYS:
NO ODD NUMBERS!
EVEN NUMBERS: 2 4 6 8 10 24 12 26 56 90
SORTED EVEN: 2 4 6 8 10 12 24 26 56 90
Thanks MORE POwer!
Well, this is my problem.
Create a program that accepts 10 positive integers. The program will group and sort all even and odd numbers. Even numbers will be sorted in ascending while odd numbers will be sorted in descending order. If theres is no even numbers found the program will print "NO even numbers" yet it prints the odd numbers, and sort it vice versa.
Use if statements or loops only.(turbo c)(no arrays or gotoxy() ]
please do help me.....
SAMPLE OUTPUT 1:
Enter 10 integers: 1 2 3 4 5 6 7 8 9 10
DISPLAYS:
even numbers:
+--------------------------+
| 2 4 6 8 10 |
+--------------------------+
odd numbers:
+---------------------------+
| 1 3 5 7 9 |
+---------------------------+
sorted even numbers:
+---------------------------+
| 2 4 6 8 10 |
+---------------------------+
sorted odd numbers:
+---------------------------+
| 9 7 5 3 1 |
+---------------------------+
SAMPLE OUTPUT 2:
ENTER TEN INTEGERS: 2 4 6 8 10 24 12 26 56 90
DISPLAYS:
NO ODD NUMBERS!
EVEN NUMBERS: 2 4 6 8 10 24 12 26 56 90
SORTED EVEN: 2 4 6 8 10 12 24 26 56 90
Thanks MORE POwer!
Comment