Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Instructions:

Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:

 

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • Assignment is copied(partial or full) from any source (websites, forums, students, etc)

 

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files or .exe file, no reward will be given in any case.

 

Objective:

 

The objective of this assignment is to provide hands on experience of:

 

  • Basic concepts of C/C++ language and Programming
  • Dealing with Data types
  • Conditional statements of C/C++ language
  • Repetition Structures (Loop)
  • Switch statement

 

 

Guidelines:

 

  • Code should be properly indented and well commented.
  • Follow C/C++ rules while writing variable names, function names etc
  • Use only dev-C++ for this assignment.

Assignment:

Problem Statement:     

 

You are required to write a C++ program using loop and switch statement. The program should display even or odd numbers from 1 to 50 depending upon the option given by the user.

 

 

Detailed Description:

 

The program should prompt the user for one character option (either ‘e’, ‘E’ or ‘o’, ‘O’).   

 

It should respond in the following ways:

  • If user enters character option ‘e’ or ‘E’ then it should display the even numbers from 1 to 50.
  • If user enters character option ‘o’ or ‘O’ then it should display the odd numbers from 1 to 50.

 

Sample output of the program:

If user enters ‘e’ then it displays the even numbers from 1 to 50. 

If user enters ‘E’ then it displays the even numbers from 1 to 50. 

If user enters ‘o’ then it displays the odd numbers from 1 to 50. 

If user enters ‘O’ then it displays the odd numbers from 1 to 50. 

Views: 5305

Attachments:

Replies to This Discussion

Muhammad Arshad brothr dwnload dev frm ur lms nd fr compilng c++ cod u dont ned any notepad.

jst submit ur fil in .cpp whch iz the extension of dev's filz.

Thanks Brother

so nice of you

cout "Enter your choice : ";

cout "Even numbers from 1 - 50 \n\n";

cout i " ";

these are still givig errors ...............

maha khan u uzed angle bracket wrong.

check the atached fil:

Attachments:

mein ne assignment submit kar de

Thank GOD

which of the two files project or source require submit on lms

source

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service