Guess number project 1-40.docx - Guess Number Project(range 1-40 Name March 4 2019 Muhammad Idrees Arif Enrollment

Guess number project 1-40.docx - Guess Number Project(range...

This preview shows page 1 - 3 out of 4 pages.

Guess Number Project (range 1-40) March 4, 2019 Name: Muhammad Idrees Arif Enrollment: 03-134191-039 #include <iostream> #include <conio.h> using namespace std; int main(){ int a; cout << "Ente Number" ; cin >> a; if (a >= 1 && a <= 3){ if (a >= 1 && a <= 2){ if (a == 1){ cout << "Number you entered is 1" ; } else { cout << "Number you entered is 2" ; } } else { cout << "Number you entered is 3" ; } } else if (a >= 4 && a <= 5){ if (a == 4){ cout << "Number you entered is 4" ; } else { cout << "Number you entered is 5" ; } } else if (a >= 6 && a <= 8){ if (a >= 6 && a <= 7){ if (a == 6){ cout << "Number you entered is 6" ; } else { cout << "Number you entered is 7" ; } } else { cout << "Number you entered is 8" ; } } else if (a >= 9 && a <= 10){ if (a == 9){ cout << "Number you entered is 9" ; pg. 1
Image of page 1
Guess Number Project (range 1-40) March 4, 2019 } else { cout << "Number you entered is 10" ; } } else if (a >= 11 && a <= 13){ if (a >= 11 && a <= 12){ if (a == 11){ cout << "Number you entered is 11" ; } else { cout << "Number you entered is 12" ; } } else { cout << "Number you entered is 13" ; } } else if (a >= 14 && a <= 15){ if (a == 14){ cout << "Number you entered is 14" ; } else { cout << "Number you entered is 15" ; } } else if (a >= 16 && a <= 18){ if (a >= 16 && a <= 17){ if (a == 16){ cout << "Number you entered is 16" ; } else { cout << "Number you entered is 17" ; } } else { cout << "Number you entered is 18" ; } }
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 4 pages?

  • Spring '19
  • ASIM ALI

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture