Uploaded by Rohan Kate

Ques Bank-1

advertisement
Dr. D.Y. Patil Unitech Society’s
Dr. D.Y. Patil Arts Commerce and Science College Pimpri
Class:- F.Y.B.Sc.(Computer Science)
Subject: - Advanced C Programming
Question Bank
Q.I. Answer the following:1. Define Pointer
2. Give syntax of Pointer
3. Give syntax of Pointer to Pointer
4. What is Address and Dereferencing Operator?
5. List pointer arithmetic operations
6. List the dynamic memory allocation functions
7. Give syntax and use of malloc()
8. Give syntax and use of calloc()
9. Give syntax and use of realloc()
10. Give syntax and use of free()
11. Define function pointer give syntax
12. What are the advantages and disadvantages of pointer?
13. How to initialize pointer
14. What is Array of pointers? Give syntax
15. List the types of pointer
16. Define String
17. List string standard library function
18. Give syntax and use of strlen, strcpy, strcat, strrev, strcmp
19. How to initialize a string
20. What is \0
21. What is Array of string give syntax?
22. Give syntax of declaring string
23. Define structure
24. Define nested structure
25. Give syntax of declaring structure
26. Define Union give syntax
27. Define File
28. List file operations
29. Give syntax and use of fopen(), fclose(), fread(), fwrite()
30. List the types of macro
31. Explain fgetc(), fputc(),fgets(), fputs(), rewind, fseek()
32. List the modes of file
33. What is command line argument?
34. Define Macro
35. List the types of files.
Q.2. Answer in brief:1. Give difference between structure and union
2. What is Array of Structure Explain?
3. Give difference between Macro and function
4. What is Array of string give syntax and example?
5. What is Array of pointer explain with example.
6. Write a note on DMA
7. Explain different string library functions
8. Explain passing structure to function
9. Write a note on Macro preprocessor
10. Explain fprintf() and fscanf() with syntax
11. Difference between static and dynamic memory allocation
12. Write a note on pointer arithmetic
13. Explain passing pointer to function with example
14. Explain returning pointer from function with example.
Q.III. Answer the following.
1. WAP to swap 2 nos using pointers
2. WAP using standard library function to:i.
Find length of string
ii.
iii.
iv.
Copy one string to other
Concat two strings
Compare two strings
3. WAP using user defined function to:i.
ii.
iii.
iv.
Find length of string
Copy one string to other
Concat two strings
Compare two strings
4. WAP to read a text file and display the contents of the file.
5. WAP to copy the contents of one file to other
6. WAP to copy the contents of one file to other (using command line argument)
7. WAP to create a structure of employee having empno, name and salary accept and display
detals of 10 employees
8. WAP to find max of 2 nos using macro
9. Write a C program to find the area of a circle by using PI as macro.
10. Define a macro EQUALNUM to compare two numbers x and y which gives 1 if they
are equal and 0 otherwise. Use this in main
11. Write a C program to accept and display details of one student (roll
number, name, percentage) using structure.
12. Create a structure employee (id, name, salary). Accept details of n
employees and find the details of employee having maximum salary.
13. Write a program to allocate memory dynamically for n integers. Accept the elements and
calculate their sum and average.
14. Write a program to compute sum and average of all elements in an array using pointer
15. WAP to count number of uppercase and lowercase letters in strings
(Also read programs done in Practical)
Download