Sunday, September 14, 2014

Day 3 - 1: Exercise gets()/puts()

1.   Write a program to accept and add three numbers.

2.  For the following values, write a program to evaluate the expression

z = a*b+(c/d)-e*f ;

  a=10
  b=7
  c=15.75
  d=4
  e=2
  f=5.6

3. Write a program to evaluate the area and perimeter of the rectangle.

4.  Write a program to evaluate the volume of a cylinder.

5.  Write a program to evaluate the net salary of an employee given the following constraints
Basic salary : $ 12000
DA : 12% of Basic salary
HRA : $150
TA : $120
Others : $450
Tax cuts – a) PF :14% of Basic salary and b) IT: 15% of Basic salary
Net Salary = Basic Salary + DA + HRA + TA + Others – (PF + IT)

*Chú ý:
- puts và gets chỉ dùng cho chuỗi
- Cấu trúc lệnh: puts(string); gets(string);
- puts sẽ đặt con trỏ ở dòng tiếp theo sau kết quả




No comments:

Post a Comment