17-05-2012, 03:57 PM
Programming Fundamentals Lab
lab#2.pdf (Size: 98.59 KB / Downloads: 28)
The program should take three integers a, b and c. Two points for this program should be noted that:
1. It should check whether a entered by user is not 0.
2. It should also check that the discriminant (b2-4ac) is not a negative number.
The program should show quadratic equation using a, b and c. It should also show the solutions, x1 and x2.
The program should ask for integers continuously and exit only when user wants to exit.
4. Write a program to make a calculator it will do addition, subtraction, multiplication and division. It should
take two values from user and ask from user what to do (do while loop). Interactive display should be like
this:
5. Write a program to find greatest common divisor of two integers. The user should enter two integers and the
program should show one greatest common divisor of both.
6. Write a program that displays greetings according to the language chosen by the user. The interactive
display should be like this:
Welcome to Greetings Program!!
Choose language from the following options to show greeting in that language:
English, French, German, Italy, Russian (e , f , g , I , r)?f