Monday, 2 October 2017

Practical-3

PRACTICAL-3
Aim of the practical:-
Write a program (WAP) to enter any three different numbers and arrange them in both ascending and descending order.
Header files used:-
#include <iostream.h>
#include <stdlib.h>
Conditional statements/Loops used:-
i.                   If statement
ii.                 If else statement
Procedures followed:-
The user will be asked to enter any three different numbers. One of the three numbers will be taken as the greatest and will be compared with the other two in successive if () statements to find out the greatest among the all.
After finding the greatest of all, the other two will be compared in successive if else statements to find the 2nd and 3rd greatest of them.

Coding:-

No comments:

Post a Comment