Sei sulla pagina 1di 6

Problems

0)
Read three values (variables A, B and C), which are the three student's
grades. Then, calculate the average, considering that grade A has weight
2, grade B has weight 3 and the grade C has weight 5. Consider that each
grade can go from 0 to 10.0, always with one decimal place.

Input
The input file contains 3 values of floating points with one digit after the
decimal point.

Output
Print MEDIA (average in Portuguese) according to the following example,
with a blank space before and after the equal signal.

Input Samples Output Samples

5.0 MEDIA = 6.3


6.0
7.0
5.0 MEDIA = 9.0
10.0
10.0

1. Write a C program to find maximum between two numbers.

2. Write a C program to check whether a number is negative, positive or


zero.

3. Write a C program to find maximum between three numbers.

4. Write a C program to check whether a number is divisible by 5 and 11


or not.

5. Write a C program to check whether a number is even or odd.

6. Write a C program to check whether a year is leap year or not.


7. Write a C program to check whether a character is alphabet or not.

8. Write a C program to input any alphabet and check whether it is vowel


or consonant.

9. Write a C program to input any character and check whether it is


alphabet, digit or special character.

10. Write a C program to check whether a character is uppercase or


lowercase alphabet.

11. Write a C program to input week number and print week day.

12. Write a C program to input month number and print number of days in
that month.

13. Write a C program to count total number of notes in given amount.

14. Write a C program to input angles of a triangle and check whether


triangle is valid or not.

15. Write a C program to input all sides of a triangle and check whether
triangle is valid or not.

16. Write a C program to check whether the triangle is equilateral,


isosceles or scalene triangle.

17. Write a C program to find all roots of a quadratic equation.

18. Write a C program to calculate profit or loss.

19. Write a C program to input marks of five subjects Physics, Chemistry,


Biology, Mathematics and Computer. Calculate percentage and grade
according to following:

Percentage >= 90% : Grade A

Percentage >= 80% : Grade B

Percentage >= 70% : Grade C

Percentage >= 60% : Grade D


Percentage >= 40% : Grade E

Percentage < 40% : Grade F

20. Write a C program to input basic salary of an employee and calculate


its Gross salary according to following:

Basic Salary <= 10000 : HRA = 20%, DA = 80%

Basic Salary <= 20000 : HRA = 25%, DA = 90%

Basic Salary > 20000 : HRA = 30%, DA = 95%

21. Write a C program to input electricity unit charges and calculate total
electricity bill according to the given condition:

For first 50 units Rs. 0.50/unit

For next 100 units Rs. 0.75/unit

For next 100 units Rs. 1.20/unit

For unit above 250 Rs. 1.50/unit

An additional surcharge of 20% is added to the bill.

 Task

Given a positive integer denoting , do the following:

 If , then print the lowercase English word corresponding to the number

(e.g., one for , two for , etc.).

 If , print Greater than 9.

Input Format

The first line contains a single integer denoting .


Constraints

Output Format

If , then print the lowercase English word corresponding to the number

(e.g., one for , two for , etc.); otherwise, print Greater than 9 instead.

Sample Input

5
Sample Output

five
Sample Input #01

8
Sample Output #01

eight
Sample Input #02

44
Sample Output #02

Greater than 9

 Task 1
Read an integer number that is the code number for phone dialing. Then,
print the destination according to the following table:
If the input number isn’t found in the above table, the output must be:
DDD nao cadastrado
That means “DDD not found” in Portuguese language.

Input
The input consists in a unique integer number.

Output
Print the city name corresponding to the input DDD. Print DDD nao
cadastrado if doesn't exist corresponding DDD to the typed number.

Input Sample Output Sample

11 Sao Paulo

 Task 2
You must make a program that read a float-point number and print a
message saying in which of following intervals the number belongs: [0,25]
(25,50], (50,75], (75,100]. If the read number is less than zero or greather
than 100, the program must print the message “Fora de intervalo” that means
"Out of Interval".
The symbol '(' represents greather than. For example:
[0,25] indicates numbers between 0 and 25.0000, including both.
(25,50] indicates numbers greather than 25 (25.00001) up to 50.0000000.

Input
The input file contains a floating-point number.
Output
The output must be a message like following example.

Input Sample Output Sample

25.01 Intervalo (25,50]


25.00 Intervalo [0,25]
100.00 Intervalo (75,100]
-25.02 Fora de intervalo

Potrebbero piacerti anche