Upload
asadhppy
View
216
Download
0
Embed Size (px)
Citation preview
8/14/2019 Data Structure - Assignments.doc
1/8
Assignment 1
Function Calling
Make four functions which operate on floating point data. Each function will take 2
input arguments (by value) and would return the result. Operations which will be
implemented includes
1. ddition
2. !ubtraction
". Multiplication
#. $ivision
$efine these functions and show how these functions will be called.
Assignment 2
Data types + sizeof() + Function Calling + Passing by value
%rite a function in which use si&eof() operator to find the intrinsic si&es of all the
available data types in ''. sk from user whether to display the si&e if
individual data types or not* Moreover+ sum the si&e of all the data types.
Assignment 3
Conditional tatement
Enter your marks and decide grade. Marks can either be taken from user or it can
be hard,coded.
Assignment !
"nt#oducto#y concept of a##ays and loops
-ind si&e of different data types and store them in an array. hen using /for0 loop+
print this array.
Assignment $
Playing %it& AC"" using loop
8/14/2019 Data Structure - Assignments.doc
2/8
ake the user name in small alphabets. Make the first small letter of every word to
capital case. $ont disturb spaces during this conversion. n eample is user will
enter /3uaid a&am0. 4our program should convert it into /5uaid &am0.
8/14/2019 Data Structure - Assignments.doc
3/8
Assignment '
Function Calling + Passing by add#ess
%rite a function which takes two arrays of type /short0 and si&e 16 as arguments+
perform dot product of these two arrays and accumulate the sum in an accumulator
of type /int0. 7eturn this sum to the calling function by value.
Assignment
ecto# p#oduct and vecto# dot p#oduct by using pointe#s
%rite two functions which takes two arrays of type /short0 and si&e 16 as
arguments. 8owever in the called function+ it performs dot product using pointer
arithmetic.
i. -unction dot9roduct() returns the sum by value.
ii. -unction vec9roduct() takes the result array also as an argument and
writes the result in it.
Assignment *
t#ing p#ocessing functions
%rite your own string processing functions like my!trcpy()+ my!trlen()+ my!tr'at()+
my!trcmp() using:
i. forloop and
ii. whileloop.
Assignment
File ,ead -#ite + t#uctu#e .sage
4ou are given a tet file (/input-ile.tt0) with integer numbers. ;t carries two
columns like as follows:
1 "1#
2 ""#
" "#