Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

PEER- REVIEWED PROGRAMMING PROBLEMS SHEET –IE322Summer18

IMPORTANT INSTRUCTIONS:

 Use comments extensively


 Use indentation properly.

WRITE THE CODE FOR FOLLOWING PROGRAMS

PROBLEM 1. Write a program in C# Sharp to read any Month Number in integer


and display Month name in the word.
PROBLEM 2. Write a program in C# Sharp to read any digit, display in the word.
PROBLEM 3. Write a program in C# Sharp to read any Month Number in integer
and display the number of days for this month.
PROBLEM 4. Write a C# Sharp program to calculate profit and loss on a
transaction. Guess the inputs required yourself.
PROBLEM 5. Write a C# Sharp program to check whether an alphabet (provided by
the user) is a vowel or consonant.
PROBLEM 6. Write a C# Sharp program to check whether a triangle is Equilateral,
Isosceles or Scalene.
PROBLEM 7. Write a C# program to accept a coordinate point in an XY coordinate
system and determine in which quadrant the coordinate point lies.
PROBLEM 8. Read a positive integer N, find all the numbers greater than 1 that
divide N.
PROBLEM 9. Read a positive integer N, find the sum of all the even integers less
than N.
PROBLEM 10. Write a program that takes as input a four-digit number in format abcd
(e.g. 2011) and performs the following actions:
a. Calculates the sum of the digits (in our example 2+0+1+1 = 4).

Dr. Atif Shahzad Page 1 of 2


PEER- REVIEWED PROGRAMMING PROBLEMS SHEET –IE322Summer18

b. Prints on the console the number in reversed order: dcba (in our example
1102).
c. Puts the last digit in the first position: dabc (in our example 1201).
d. Exchanges the second and the third digits: acbd (in our example 2101).
PROBLEM 11. Write a program that checks if a given number n (1 < n < 100) is a
prime number (i.e. it is divisible without remainder only to itself and 1).
PROBLEM 12. Write a program that reads an integer number n from the console.
After that reads n numbers from the console and prints their sum.
PROBLEM 13. Write a program that prints on the console the first 100 numbers in the
Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, …

PROBLEM 14. Program that will calculate the sum of all odd integers in the range
[1…n], which are not divisible by 7 by using the for-loop

Dr. Atif Shahzad Page 2 of 2

You might also like