C Assignment_
C Assignment_
1. Basic Programs
2. Control Statements
5. Write a C program to find the largest number among three numbers using if-else.
6. Write a C program to check if a given number is prime.
7. Write a C program to display the Fibonacci series up to n terms.
8. Write a C program to find the factorial of a number using recursion.
5. Advanced Concepts
Extra Assignments for students who have secured less than 10 marks
in the Quiz: Last Two year GTU question papers (Summer 2024 and Summer 2023)
1. Write a C Program to find Largest Element of an Integer Array. Here the number of
elements in the array ‘n’ and the elements of the array is read during runtime.
2. Write a C Program to print the array elements in reverse order (Not reverse sorted
order). Just the last element will become first element, second last element will
become second element and so on)
3. Write a C program to find subtraction of two matrices i.e. matrix_A - matrix_B =
matrix_C.
If the given matrix are
235 and 1 5 2
456 2 3 4
657 3 3 4
Then the output will be
1 -2 3
2 2 2
3 2 3
(The elements of the output matrix are separated by one blank space)
4. Write a C program to print a triangle of prime numbers up to given number of lines of
the triangle. e.g If number of lines is 3 the triangle will be
2
3 5
7 11 13
5. Write a program to print all the locations at which a particular element (taken as
input) is found in a list and also print the total number of times it occurs in the list.
The location starts from 1.
For example if there are 4 elements in the array
5
6
5
7
If the element to search is 5 then the output will be
5 is present at location 1
5 is present at location 3
5 is present 2 times in the array.