C Assignment-2
C Assignment-2
C Assignment-2
,)
Programming Simplified
Assignment 2
Note:
1. Please ut do!n "our code in !hite aers and also do it racticall" in "our home
director".
2. #aintain roer indentation and error handling mechanism
$. %o not co" and aste &rom the internet.
1. 'rite a simle ()) rogram to demonstrate inline &unctions are *etter than (
macros.
2. %etermine ho! to get "our comiler to generate assem*l" code. (reate a &ile
containing a +er" small &unction and a main that calls a &unction. Generate
assem*l" code !hen the &unction is inlined and not inlined and demonstrate that
the inline +ersion does not ha+e the &unction call o+erhead.
$. 'rite a ()) rogram that ta,es a string at the command line argument. 'rite a &or
loo that remo+es one character &rom the string !ith each ass and rint the
resultant string at each ass.
-. .mlement a /TA(0 header &ile (stac,.h), /TA(0 li*rar" (li*/tac,.a) and t!o
di&&erent alications (A1sing/tac,1.c and A1sing/tac,2.c) &or !or,ing on
t!o di&&erent data t"es (int and &loat).
2. Gi+en that an 3#P45633 class contain the &ollo!ing mem*ers:
%ata mem*ers: Employee number, Employee name, Basic pay, DA, IT, Net Salary
#em*er Functions: To read the data of N employees, compute the Net Salary of each
employee.
(Dearness Allowance (DA ! "#$ of Basic, Income Ta% (IT ! &'$ of the (ross salary,
Net Salary ! Basic ) DA * IT
7. %e&ine a /T1%3NT class !ith 1/N, Name and #ar,s in $ tests o& a su*8ect.
%eclare an Arra" o& 19 /T1%3NT o*8ects. 1sing aroriate &unction, &ind the
a+erage o& t!o *etter mar,s &or each student. Print the 1/N, name and a+erage
mar,s o& all students.
:. 'hat do "ou mean *" comosition; %emonstrate !ith e<amles.
=. 'hat do "ou mean *" >has?a@ relationshi; %emonstrate !ith e<amles.