UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
complex c programming
1. Department of Computer Science & Engineering
Motilal Nehru National Institute of Technology, Allahabad
Class: B.Tech 2nd Semester 2014
Subject: Computer Programming Lab (CS1255)
Assignment - 6
INSTRUCTIONS
Write comment to make your programs readable.
Use descriptive variables in your programs(Name of the variables should show
their purposes)
PROGRAMS LIST
1. Define a structure called cricket that will describe the following information Player
name, Team name, Runs Using cricket, declare an array player with 10 elements and write
a program to read the information about all 10 players and print a team-wise list
containing names of players with their runs.
2. In a program declare following structure member: name, code, age, weight and height.
Read all members of the structure for 10 persons and find list of persons with all related
data whose weight > 50 and height > 40 and print the same with suitable format and title.
3. WAP using concept returning a structure variable from a function on given scenario,
enter a employee details (name, designation, address, salary).
Hints: i. address must be enter by nested structure like: HN no, city, pin.
ii. Use two function display(), that display the employee details.
iii. And salary_bouns(), that add 15% extra on gross salary if employee is
more than 2yr of experience in that company.
4. Write a menu driven program to read a number of different C keyword from the user
and display each keyword along with their frequencies. Use suitable structure to
represent a keyword and its frequencies.
Hint: struct
{
char *keyword;
int count;
}keytab[N];
2. 5. A symbol table is a table that can store constants of different types. Constants can be an
int,a float,or a character string. For convenient of table management the various
constant occupies the same amount of storage and is stored in the same place
regardless of its
type. A symbol table is represented by an array of structures as follows:
struct
{
char *name;
int utype;
union{
int ival;
float fval;
char *sval;
}u;
}symtab[N];
Where N is the number of enteries in the symbol table and utype is a constant
whose values are 1,2 and 3 respectively for the int, float and string constants. Read a
number of constant along with their types, names and values and store them in the
table. Then display the table.