Anda di halaman 1dari 1

C-Programming (For Civil Students) - Laboratory Programs

Lab - 6 : Patterns
Write a program to print the following Patterns.
1 5 a 1
12 44 bb 121
123 333 ccc 12321
1234 2222 dddd 1234321
12345 11111 eeeee

12345 11111 55555 1


1234 2222 4444 212
123 333 333 32123
12 44 22 4321234
1 5 1

Lab - 7 Arrays
1. Write a program to find maximum element from 1-D array.
2. Write a program to find number of odd and even elements from 1-D array.
3. Write a program to sort a given array in ascending order using bubble sort.
4. Write a program to delete an element from 1-D array.
5. Write a program to insert an element in 1-D array at specified place.
6. Write a program to remove duplicate elements from a given 1-D array

Lab - 8 : 2D Arrays
1. Write a program to print transpose of a matrix.
2. Write a program to count number of positive, negative and zero elements from 3x3 matrix.
3. Write a program to check whether a matrix is upper triangular matrix or not.
4. Write a program to print Pascal’s triangle using 2-D array.
5. Write a program to scan two matrices A and B and find A*B and |A+B|.
6. Write a program to check whether a matrix is symmetrical matrix or not.

Lab - 9 : Strings
1. Write a program to count number of words in a string.
2. Write a program replace a particular character in a string.
3. Write a program to toggle the characters in a given string.
4. Write a program to check whether a string is palindrome or not.
5. Write a program to append a string.

Lab - 10 : User Defined Functions


1. Write a function program to find sum of square of first ‘n’ numbers.
2. Write a function program to find factorial of a given number.
3. Write a function program to find maximum of 20 numbers.
4. Write a function program to find x^y.
5. Write a function program to reverse a string.