Create a c++ program that accepts 5 integers in ascending order without using array or looping. Pure else and if statements.

Recommended Answers

No one is going to do your homework for you. If you hadn't waited to the last minute you could have posted your code and asked for help.

Jump to Post

All 4 Replies

Re: Just help me with this one 80 80

I just need it badly. I am going to fail my subject if i could not pass it until tommorow morning. Please help

Re: Just help me with this one 80 80

Please help. Is there anyone here that can program that one? Please answer me. Thank you

Re: Just help me with this one 80 80

No one is going to do your homework for you. If you hadn't waited to the last minute you could have posted your code and asked for help.

Re: Just help me with this one 80 80

Using strictly your requirement this appears to be a 2 line exercise. Nowhere did you write the user input the values with cin or much else. You wrote the program accepts the 5 integers. This is a good example where the specification means a lot more than some folk think it does. The spec you supplied did not demand user input. So this is pretty easy and I worry that you need to spend time on your class work.

#include <iostream>

using namespace std;

int main()
{
  int a=1,b=2,c=3,d=4,e=5;
  cout << a << b << c << d << e << endl; 
  return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.