Vous êtes sur la page 1sur 8

OUTPUT: 1

[mecse@localhost mecse]$cc sem.c-lpthread


[mecse@localhost mecse]$.\a.out
AAAAABCAABCAB
OUTPUT:2
Agent: putting paper matches
Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!
Smoker 3: Getting paper matches - Yes!
Smoker 3: I got what I needed!
Smoker 3: Rolling.
Smoker 3: Smoking.
Smoker 3: Done smoking.
Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!

Agent: putting paper matches


Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!
Smoker 3: Getting paper matches - Yes!
Smoker 3: I got what I needed!
Smoker 3: Rolling.
Smoker 3: Smoking.
Smoker 3: Done smoking.
Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!

Agent: putting paper matches


Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!
Smoker 3: Getting paper matches - Yes!
Smoker 3: I got what I needed!
Smoker 3: Rolling.
Smoker 3: Smoking.
Smoker 3: Done smoking.
Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!

Agent: putting paper matches


Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!
Smoker 3: Getting paper matches - Yes!
Smoker 3: I got what I needed!
Smoker 3: Rolling.
Smoker 3: Smoking.
Smoker 3: Done smoking.
Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - No!
Agent: putting tobacco paper
Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - Yes!
Smoker 2: I got what I needed!
Smoker 2: Rolling.
Smoker 3: Getting paper matches - No!
Smoker 2: Smoking.
Smoker 2: Done smoking.
Smoker 2: Getting tobacco paper - No!

Agent: putting tobacco paper


Smoker 1: Getting tobacco matches - No!
Smoker 2: Getting tobacco paper - Yes!
Smoker 2: I got what I needed!
Smoker 2: Rolling.
Smoker 3: Getting paper matches - No!
Smoker 2: Smoking.
OUTPUT:3
This is a barber shop with 5 chairs for waiting.
Here is 7 customers want to cut hair.
First,the barber is sleeping for there is no customer.
customer-2 enter shop.
There are 1 chairs occupied.
customer-2 is barbering. There are 0 chairs occupied.
customer-0 enter shop.
There are 1 chairs occupied.
customer-1 enter shop.
There are 2 chairs occupied.
customer-2 is done barbering. There are 2 chairs occupied.
customer-0 is barbering. There are 1 chairs occupied.
customer-3 enter shop.
There are 2 chairs occupied.
customer-4 enter shop.
There are 3 chairs occupied.
customer-5 enter shop.
There are 4 chairs occupied.
customer-0 is done barbering. There are 4 chairs occupied.
customer-1 is barbering. There are 3 chairs occupied.
customer-6 enter shop.
There are 4 chairs occupied.
customer-1 is done barbering. There are 4 chairs occupied.
customer-3 is barbering. There are 3 chairs occupied.
customer-3 is done barbering. There are 3 chairs occupied.
customer-4 is barbering. There are 2 chairs occupied.
customer-4 is done barbering. There are 2 chairs occupied.
customer-5 is barbering. There are 1 chairs occupied.
customer-5 is done barbering. customer-6 is barbering. There are 0 chairs
occupied.
There are 0 chairs occupied.
customer-6 is done barbering. The barber begin to sleep .
There are 0 chairs occupied.
OUTPUT:5
Press:-

A: for alarm Clock

T: for Timer

Enter your Choice:A

24 hr Format(HH:MM:SS)

Enter alarm time : 12:45:00

Alarm time: 12:45:00

Current Time: 12:42:15


OUTPUT:6
ACCOUNT NO.:AC1
MESSAGE :withdraw
AMOUNT :500
ACCOUNT NO.:AC1
MESSAGE :deposit
AMOUNT :200
withdraw 500
deposit 200
Before Transaction
ACCOUNT NO.:AC1
BALANCE :1000
Before Transaction
ACCOUNT NO.:AC1
BALANCE :1000
ACCOUNT NO.:AC1
BALANCE :1200
ACCOUNT NO.:AC1
BALANCE :700
OUTPUT:7

Vous aimerez peut-être aussi