You are on page 1of 3

Techno India EM-4/1, Sector-V, Salt Lake City, Kolkata- 700091

Sample Programs for CSE-E, 2nd Sem

Ass. No. 1.

Sample Programs Write a C program to search a given data from a set of data values.

2.

Write a program to print all the ASCII values and their equivalent characters using a while loop. The ASCII values vary from 0 to 255.

3.

Write a C program to insert a particular element in a specified position in a given array after sorting the array. Program to accept N integer number and store them in an array AR. Copy the odd elements of array AR to another array OAR and other elements to another array EAR. Display the contents of OAR and EAR Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeroes entered.

4.

5.

6.

Write a program using recursive C function to calculate factorial of a number. A library charges a fine for every book returned late. For first 5 days the fine is 50 paise, for 6-10 days fine is one rupee and above 10 days fine is 5 rupees. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine or the appropriate message. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Write a program to print the multiplication table of the number entered by the user. The table should get displayed in the following form. 29 * 1 = 29 29 * 2 = 58

7.

8.

9.

Department of CSE

Page 3 of 3

Techno India EM-4/1, Sector-V, Salt Lake City, Kolkata- 700091

Sample Programs for CSE-E, 2nd Sem Ass. No. 10.

Sample Programs Write a C program to arrange a set of n numbers in ascending order.

11.

Write a C program to swap two values using Call-by-Reference mechanism.

12.

Write a C program to multiply two 2D matrices and display the resultant matrix. Write a C program to check whether a given number is prime or not. The program should handle all the possible conditions.

13.

14.

A 5-digit positive integer is entered through the keyboard, write a function to calculate sum of digits of the 5-digit number.
If the three sides of a triangle are entered through the keyboard, write a C program to check whether the triangle is valid or not. The triangle is valid if the sum of two sides is greater than the largest of the three sides. Write a C program that will accept a decimal number provided by the user and converts it to the users desired base using Switch-Case.

15.

16.

17.

Write a C program to count the number of vowels in a string provided by the user.

18.

Write a C program to find the maximum and minimum number from a given set of numbers provided by the user.

Department of CSE

Page 3 of 3

Techno India EM-4/1, Sector-V, Salt Lake City, Kolkata- 700091

Sample Programs for CSE-E, 2nd Sem Ass. No. 19.

Sample Programs
Write a C program to check whether a given string is palindrome or not.

20.

Write a C program to reverse a string : Input : AB CD EF GH Output : GH EF CD AB Write a C program to read a file and count the number of lowercase, uppercase letters and black space.

21.

22.

Write a C program to count the frequency of all words in a file.

Department of CSE

Page 3 of 3

You might also like