Advance C Prog FYBCA
Advance C Prog FYBCA
For: FYBCA
Topics Covered: Strings, Pointers, File Handling, Preprocessor Directives, Command Line Arguments,
Arrays
4. How many arguments does main() take when using command line arguments?
A) 1 B) 2 C) 3 D) 0
Answer: B) 2
7. Write a C program to implement a simple file handling program that writes user input into a
file.
8. Write a C program using arrays and pointers to find the sum of elements in an integer array.
9. Write a C program to copy one string into another without using strcpy().
10. Write a C program to take input from the user and save it in a text file.
11. Write a C program that demonstrates the use of #define and #include directives in C.
12. Write a C program that implements the use of #ifdef and #endif preprocessor directives to
check if a variable is defined or not.
14. Write a C program to compare two strings without using the strcmp() function.
15. Write a C program that accepts data from a file and counts the number of words in it.
16. Write a C program to implement a simple calculator that performs addition, subtraction,
multiplication, and division.
17. Write a C program to sort an array of integers in ascending order using pointers.
18. Write a C program to demonstrate the use of #ifdef, #ifndef, and #endif preprocessor
directives.