C Programming Assignment
C Programming Assignment
C-Programming (BCA-S106T)
UNIT-I
1. What is array? How it is defined? How array is initialized? How an element of an array is
accessed?
2. Write a program that prompts user to input value in an array of integer type and print the
reverse of that array.
3. Write a program to search a value in an array and print its position (index) if it is found
otherwise print -1.
4. How an array of character type is defined and initialized? How a string constant will be
assigned in an array?
5. Write a program to find greatest number in a given array.
6. Write a program to find the position of a character in a string.
7. How array are passed to a function? Write a function to convert a string in capital case.
8. Write a function to convert a string in small case.
9. Write a function to convert a string in title case.
10. Write a program that prompts user to input a string and find the following in that string:-
• Number of vowels.
• Number of consonants.
• Number of digits.
• Number of special characters.
11. Write a program that prompts user to input a string and find number of words in the
string. Words can be separated by more than one spaces and any other punctuation
marks.
12. Write a function to sort an array using bubble sort technique.
13. Write a function to sort an array using selection sort technique.
14. Describe different types of array. How two dimension array is defined and initialized? How
the elements of two dimensional array are accessed?
15. Write a program to print transpose of a matrix.
16. Write a program tow add two matrices.
17. Write a program tow multiply two matrices.
18. Write a program to print the sum of each row and each column of a given matrix.
19. How array are represented in memory? Describe the row major and column major
representation of a matrix.
UNIT-II
1. What is pointer? How it is defined? Describe the indirection and address of operator.
2. How arithmetical operations are performed on pointer. Describe it with a suitable
example by taking different types of pointers.
3. What is dynamic memory allocation? How it is achieved in ‘C’ language? Describe the syntax of
malloc(), calloc() and free() functions. What is void type pointer and NULL pointer?
4. Describe the comparison between array and pointer with an example.
5. What is pointer to function? How it is defined and initialized? How functions are call by the pointer
to function?
6. What is C Constant Pointers and Pointer to Constants?
UNIT-III
1. What is string? How it defined and initialized?
2. Write a program to find the length of a string.
3. Write a function to copy a string in other string.
4. Write a function to concatenate a string in another string.
5. Describe the following library functions with examples:-
strlen(), strcpy(), strcat(), strcmp()
UNIT-IV
1. What is structure? How it is defined? Describe it with example?
2. How the fields of a structure are access with the variable and pointer of structure type?
3. What is nested structure? Give an example.
4. How the array of structure is defined? Write a program to store and print the records of students
with fields RegNo, Name, and marks.
5. What is union? How it is defined? Describe it with example?
6. Write the difference between structure and union.
7. What is enumerated data type? How it is defined and used?
8. Describe the keyword typedef with an example. What is const qualifier?
UNIT-V
1. What is preprocessor? Describe the following with example:-
a. File inclusion directive.
b. Macro substitution.
c. Conditional compilation.
2. What is bit wise operator? Describe different type of bit wise operators with examples. What is the
application of bit wise operators?
3. Write a program to set a bit at a third bit position of a character type variable.
4. Write a program to unset a bit at a third bit position of a character type variable.
5. Write a program to find a bit at a third bit position of a character type variable.
6. Write a program to print all the bits of a character type variable.
7. What is bit field? How it is defined?
UNIT-VI
1. What is file? What are the operations that can be done on file? What is FILE type pointer?
2. Describe the different type of file opening modes.
3. Describe the fopen(), fclose(), fgetc(), fputc() functions with proper syntax.
4. Write a program to print the contents of a file.
5. White a program to copy the contents of a file to another file.
6. Describe the fgets(), fputs(), fscanf(), fprinf(), fread(), and fwrite() functions with proper syntax.
7. Describe the fseek(), ftell(), rewind() functions with proper syntax.
8. Write a program to change the tenth character of the contents of a file.
9. What is command line arguments? Write a program to print the sum of all the numbers coming
from the command line.
10. Make a command similar to the copy and type command of DOS.
->>>>>O<<<<<-