0% found this document useful (0 votes)
197 views3 pages

Khushwant Singh

The document contains 30 programming problems related to C programming language. Some of the problems involve basic concepts like data types, operators, control structures etc. Others involve array processing, string manipulation, functions, pointers, recursion, structures and dynamic memory allocation. The problems cover a wide range of C programming concepts and provide practice on developing logical skills for problem solving through programming.

Uploaded by

abhishek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
197 views3 pages

Khushwant Singh

The document contains 30 programming problems related to C programming language. Some of the problems involve basic concepts like data types, operators, control structures etc. Others involve array processing, string manipulation, functions, pointers, recursion, structures and dynamic memory allocation. The problems cover a wide range of C programming concepts and provide practice on developing logical skills for problem solving through programming.

Uploaded by

abhishek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

R V COLLEGE OF ENGINEERING

[Autonomous Institute Affiliated VTU, Belagavi]


DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
BENGALURU – 560059

PROGRAMMING IN C LAB
[18CS13/23]
1 Write a C program to read a string and sort it alphabetically.
2 Write a C program to swap two numbers using call by reference method.
3 Create a structure called student with the following members student name, rollno, and a
structure with marks details in three tests. Write a C program to create N records and
a) Search on roll no and display all the records.
b) Average marks in each test.
c) Highest marks in each test.
4 Write a C program to check whether the entered year is leap or not.
5 Design a structure 'Complex' and write a C program to perform the following operations:

i. Reading a complex number.


ii. Addition of two complex numbers.

6 Write a C program to input a number and check whether the number is palindrome or not.
7 Compute the roots of the equation ax2 + bx + c = 0 and print using three-decimal places.
The roots are real −b±√D/ 2aif the discriminant D = b2−4ac is non-negative. If the
discriminate is negative, then the roots are complex conjugate−b /2a ±√−Di/ 2a.The
program proceeds in the following steps.

a) The program should accept the values of a, b and c from the keyboard.
a) No solution if both a and b are zero. The program terminates with appropriate
message.
b) Linear equation if a = 0 but b ≠ 0 and the root is −c/b. The program prints out the
root with appropriate message and the program terminates.
c) Calculate the discriminant D and determines the corresponding roots.
d) Display all possible roots of a quadratic equation with appropriate message.
8 Write a program to print the prime numbers in a range entered by user.
9 Design and develop using an iterative problem solving approach for Taylor series
approximation for five decimal digits to compute Sin(x)= x - x3/3! + x5/5! - x7/7! +
x9/9!..............Xn / n!. Read the value for N.
10 Write a C program to check whether the number entered is prime or not.
11 Write a C program to read a list of N integer numbers in an array and print the following:
(i) the maximum value
(ii) the minimum value
(iii) the range
Hint: This is computed as maximum-minimum.
(iv) the average value
Hint: To compute this, add all the numbers together into sum and count them all in Count.
The average is Sum/Count
12 Write a C program to find the length of the string without using library function.
13 Write C user defined functions
a) To input N integer numbers into a single dimension array.
b) To sort the integer numbers in descending order using selection sort technique.
c) To print the single dimension array elements.
Using these functions, write a C program to input N integer numbers into a single
dimension array, sort them in descending order, and print both the given array & the
sorted array with suitable headings. (Not simple selection sort).
14 Write a C program to generate any one patterns as given below:
i) ( to print * if it is even number) ii)
1 55555
** 4444
333 333
**** 22
55555 1

15 Develop and demonstrate a C program for Matrix multiplication:


a) Read the sizes of two matrices and check the compatibility for multiplication.
b) Perform matrix multiplication and print the result along with the input matrix.
16 Using functions develop a C program to perform the following tasks by parameter passing
concept:
a)To read a string from the user
b) Print appropriate message for palindrome or not palindrome
17
Write a C program to insert a character at specified position and move the remaining
character to right.

18 Write a C program to generate Fibonacci series using recursion.


19 Write a C program to read matrix of mXn order from the user and display whether it is
lower triangular matrix or upper triangular matrix.
20 Write a C program to check whether the entered number is positive, negative or zero.
21 Write a C program to count vowels and consonants in a string using pointer.
22 Write a C program to perform the following operations using recursive functions:
a)GCD, LCM (Using GCD method)
b)Factorial of a Number
23 Write a program to enter a sentence and print total number of vowels and each vowel
count separately.
24 Simple computational problems using arithmetic expressions and use of each operator
leading to implementation of a commercial calculator with appropriate output.
25 Write a C program to read and find the frequency of characters in a given string.
26 Write a C program to search an element using Binary search.
27 Demonstrate a C program that reads N integer numbers and arrange them in ascending or
descending order using bubble sort technique.
28 Write a C program to read a matrix A[m*n] and to find the following using functions:
a) Sum of elements of each row.
b) Sum of elements of each column.
c) Sum of all the elements of matrix.
d) Sum of principle diagonal elements
29 Write a C program to check whether a number is a power of 2 or not.
30 Write a program to print out a multiplication table as given below.
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
4 8 12 16 20 24 28 32 36 40
5 10 15 20 25 30 35 40 45 50

You might also like