Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Write a program, and show the output too ) C programming Write functions in three file : 1. deposit.c void deposit ( float *bal, float

(Write a program, and show the output too) C programming

Write functions in three file :

1. deposit.c

void deposit ( float *bal, float amount )

{

*bal = *bal + amount;

}

2. withdraw.c

void withdraw ( float *bal, float amount )

{

*bal = *bal - amount;

}

3. atm.c

int main ( )

{

float balance = 200.00 ;

deposit ( &balance , 10 ) ;

printf ( " Balance %f " , balance ) ;

withdraw ( &balance, 20 ) ;

printf ( " Balance %f " , balance ) ;

}

Create a make file to compile and link all three files.

Do not change the names of the three files: deposit.c , withdraw.c and atm.c

I will use your makefile to compile my versions of the files.

1. Just submit the makefile.

2. Your makefile should be able to compile individual files: deposit.c and withdraw.c

3. Your makefile should create a executable file : atm which I will execute and check. In other words, your makefile should have a target named atm will generate the executable

4. Your makefile should also have a target named clean that will erase all *.o files.

Make sure you don't delete *.c or *.txt files.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions