Lab 2a - Arithmetic (Updated)
Lab 2a - Arithmetic (Updated)
OBJECTIVES:
For every C program that you write (either for lab exercises or lab assignments), please use the
following template:
/*************************************************************
Author: Your name
Date: date
Description: basic description of what your program does – what
does it solve?
Input: list of input required by your program
Output: list of output produced by your program
*************************************************************/
#include <stdio.h>
void main(void)
{
}
Exercises (Please do ALL):
1. Write a program to read the price of an item in decimal form
like (75.95) and print the output in halala (7595 halala)
Output:
1
Write a program to determine the salvage value of an item when
the purchase price, years of service and depreciation are given
Output:
2
6.
Algorithm: Flowchart:
Step 1: start
Step 2: read a, b, c
Step 3: avg = (a + b + c) /3
Step 5: stop
Output: