Assignment III - Advanced 'C'


Assignment III


    1. Write a menu driven program to perform the following operations on strings using standard library functions : 1. Convert string toupper case 2. Copy one string to another 3. Compare two strings 4. Concatenates two strings.


2.     A Write a program to  declare  a structure  person  (name, address)  which  contains another structure birthdate (day,month, year). Accept the details  of n persons and display them.


3.      
Write a program to accept ‘n’ employee details (eno, ename, salary) an display all employee details whose salary is more than 10000, by passing  array of structure to the function.


4.     Write a C program to create structure employee (id, name,salary). Accept details of n employees and perform the following operations:a.      Display all employees.b.     Display details of all employees having  salary >           .



 5.     Write a C program to accept details of n items (code, name,price) using structure. Perform the   following operations:Display all items having price  >_______   and  Search for an item by name.

 



6.     Write a C program to create a structure named student that accepts student  roll no, name and marks of 3 subjects. Calculate the total of marks and percentage. Create an array of structures to enter  information  for  n students and display the details.




7.
Write a C program to create a structure named book (book_name, author_name and price) and display all book details having price > 500 in a proper format by passing the structure array as function argument.

.


 8.     A Write a C program that accepts  a  string and  character  to search.  The  program will call a function, which will search for the position of occurrence of the character in the string and return its position. Function should return –1 if the character is not found in the string.




     9.      A file “student.txt” contains roll no, name and total_marks. Write a program to read this file to display all student details on screen.



    10.  Write a program to accept names of ‘n’ cities. Find the name of the city having maximum characters.



11.  Write a function which accepts a number and three flags as parameters if number is even set first flag to 1. If number is prime set second flag to 1  and if number is  divisible by 3 or 7 set the third flag to 1(pass addresses of flags to the function.)



12.  Write a menu driven program  for the following options: 1.Calculate the length of a string    2. Copy one String to another  3, Convert string to uppercase (Write separate user defined function for each option.)



13.  Write a  program to accept details of  ‘n’ cricket players (name,  type). If type = 1 (batsman), accept batting_average. If type=2 (bowler),accept number_wickets. Use nested union. Display information of all batsmen and bowlers.



14.  Write a C program to accept file name and character as command line arguments and count number of occurrences of given  character in the  file.



15. Write a C program to accept and display a matrix of order nXn. Use dynamic memory allocation. Also calculate sum of diagonal elements.


16.  Write a program to add two matrices and display the result. Use dynamic memory allocation.

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.