0% found this document useful (0 votes)
1K views

CS8261-C Programming Lab - Questions - July 2021-Batch1

The document contains details of a C programming laboratory exam conducted by Anna University, Chennai for students of Amrita College of Engineering and Technology. It lists 10 register numbers and for each it provides 2 questions to be answered - (a) and (b). The questions involve writing and executing C programs to perform tasks like sorting arrays, matrix operations, checking number properties, functions and more.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

CS8261-C Programming Lab - Questions - July 2021-Batch1

The document contains details of a C programming laboratory exam conducted by Anna University, Chennai for students of Amrita College of Engineering and Technology. It lists 10 register numbers and for each it provides 2 questions to be answered - (a) and (b). The questions involve writing and executing C programs to perform tasks like sorting arrays, matrix operations, checking number properties, functions and more.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

9 6 2 3 2 0 1 0 4 0 0 1
Register Number:

Given a set of numbers, write and execute a c program to find the sum of weights
based on the following conditions.

(a) • 5 if it is a perfect cube.


• 4 if it is a multiple of 4 and divisible by 6.
5 • 3 if it is a prime number.
Sort the numbers based on the weight in the increasing order
(b) Write and execute a C program to convert the given decimal number into binary
number using user defined function

Register Number: 9 6 2 3 2 0 1 0 4 0 0 2

(a) Write and execute a C program for sorting an array of N data in Ascending order

8 (b) Write and execute a C program for Matrix addition using two dimensional arrays
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM
9 6 2 3 2 0 1 0 4 0 0 3
Register Number:

Write and execute a C program to generate numbers between 1 and 100 which are
(a)
divisible by 2 and are not divisible by 3 and 5.
3
(b) Write and execute a C program for Matrix addition using two dimensional arrays

9 6 2 3 2 0 1 0 4 0 0 4
Register Number:

(a) Write and execute a C program for Matrix subtraction using two dimensional arrays

6 (b) Write and execute a C program to convert the given decimal number into octal number
using user defined function

Register Number: 9 6 2 3 2 0 1 0 4 0 0 5

Write and execute a C program to check whether the given number is an Armstrong
(a)
number or not
1
Develop and execute a ‘C’ program to store ‘N’ numbers in an array and print the
(b)
numbers that are divisible by five with the array location.
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

Register Number: 9 6 2 3 2 0 1 0 4 0 0 6

Write and execute a program in C to display the name of the day, depending upon
(a)
the number entered from the keyboard using switch statement
4
Write and execute a C program to calculate and display the total and average of
(b)
N student marks

9 6 2 3 2 0 1 0 4 0 0 7
Register Number:

(a) Write and execute a C program to find the min and max number in an array

7 (b) Write and execute a C program to convert the given decimal number into hexadecimal
number using user defined function

9 6 2 3 2 0 1 0 4 0 0 8
Register Number:

Write and execute a C program to swap two number using pass by value and
(a)
references
10
(b) Write and execute a C program to print the Transpose of a Matrix
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM
Register Number: 9 6 2 3 2 0 1 0 4 0 0 9

Write and execute a C program that accepts 4 real numbers from the keyboard and prints
(a)
out the difference of the maximum and minimum values of these numbers
9
Write and execute a C program to populate an array with height of persons and find how
(b)
many persons are above the average height.

Register Number: 9 6 2 3 2 0 1 0 4 0 1 0

(a) Write and execute a C program for sorting an array of N data in Ascending order

8 (b) Write and execute a C program for Matrix addition using two dimensional arrays

9 6 2 3 2 0 1 0 4 0 1 1
Register Number:

(a) Write and execute a C Program to find whether a given number is a prime number

11 Write and execute a C program to populate a two dimensional array with height and
(b)
weight of persons and compute the Body Mass Index of the individuals
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM
9 6 2 3 2 0 1 0 4 0 1 2
Register Number:

Write and execute a C program to find the factorial of given number using recursive
(a)
function

Write and execute a C Program to implement payroll application with the given data by using
15 structure.
HRA=18% of basic Pay
DA=15% of Basic Pay
(b) PF =10% of Basic Pay
LIC=7% of Basic Pay ,
Deduction= PF + LIC
Gross Salary = Basic Pay + HRA + DA
Net Salary = Gross Salary – Deduction

Register Number: 9 6 2 3 2 0 1 0 4 0 1 3

Write and execute a ‘C’ program to read an array of ‘N’ integers and print its
(a)
elements in reverse order.
13
Given a string “a$bcd./fg” write and execute a C program to find its reverse without
(b) changing the position of special characters (Example inpu t: a@gh%;j and output :
j@hg%;a)

Register Number: 9 6 2 3 2 0 1 0 4 0 1 4

14 (a) Write and execute a C program to check whether the given year is leap year or not

(b) Write and execute a C program to Sort the list of numbers using pass by reference

.
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

9 6 2 3 2 0 1 0 4 0 1 5
Register Number:

Write and execute a C program for finding String Length, String


(a)
Concatenation, String Comparison and String Copy using Library function
12
(b) Write and execute a C program to sort the given names in alphabetical order

9 6 2 3 2 0 1 0 4 0 1 6
Register Number:

(a) Write and execute a C program to find the square and cube of a number using a function

18 Write and execute a C program to generate student mark sheets with subject details and
(b)
the grades using Structure.

Register Number: 9 6 2 3 2 0 1 0 4 0 1 7

Given FOUR strings s1: BE, s2: HELPFUL, s3: TO and s4: OTHERS.
(a) Develop and execute a C program to concatenate the strings and display the result as BE
HELPFUL TO OTHERS.
Write and execute a C Program to implement payroll application with the given data by using
structure.
17 HRA=18% of basic Pay
DA=15% of Basic Pay
(b) PF =10% of Basic Pay
LIC=7% of Basic Pay ,
Deduction= PF + LIC
Gross Salary = Basic Pay + HRA + DA
Net Salary = Gross Salary – Deduction
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

Register Number: 9 6 2 3 2 0 1 0 4 0 1 8

Develop and execute a C function that will scan a character string passed as an argument
(a)
and convert all lower-case characters to their upper-case equivalents
16
(b) Write and execute a C program to solve towers of Hanoi using recursion.

9 6 2 3 2 0 1 0 4 0 1 9
Register Number:

Write and execute a C program to find maximum of given three numbers using parameter
(a)
Passing
21
Write and execute a C program to compute internal marks of students for five
(b)
different subjects using structures and functions.

9 6 2 3 2 0 1 0 4 0 2 0
Register Number:

20 (a) Write and execute a C program to find the sum of ‘N’ natural number using function

(b) Write and execute a C program to generate salary slip of employees using structures
and pointers.
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

Register Number: 9 6 2 3 2 0 1 0 4 0 2 1

Write and execute a C program to generate numbers between 20 and 100 which are
(a)
divisible by 2 and not divisible by 3 and 5

Write and execute a C program to create a structure called employee with name,
19
(b) employee id, name, age, designation and salary as data members. Accept five employee
details and display it.

Register Number: 9 6 2 3 2 0 1 0 4 0 2 2

Write and execute a C program to accept any single digit number and print it in
(a)
words.
24
(b) Write and execute a C program to solve towers of Hanoi using recursion.

9 6 2 3 2 0 1 0 4 0 2 3
Register Number:

(a) Write and execute a C Program to generate Fibonacci series from 1 to n

23 Write and execute a C program to create a structure called employee with name,
(b) employee id, name, age, designation and salary as data members. Accept five
employee details and display it.
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

9 6 2 3 2 0 1 0 4 0 2 4
Register Number:

(a) Write and execute a C program to find the biggest of given three numbers

25 Write and execute a C program to count the number of account holders whose
(b)
balance is less than the minimum balance using sequential access file.

9 6 2 3 2 0 1 0 4 0 2 5
Register Number:

(a) Write a C program to find whether the given string is Palindrome or not

22 (b) Write a C Program to implement calculation of subject average of students using union

9 6 2 3 2 0 1 0 4 0 2 6
Register Number:

(a) Write and execute a C program to find whether the given number is even or odd

26 (b) Write and execute a C program to Sort the list of numbers using pass by reference
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM
9 6 2 3 2 0 1 0 4 0 2 7
Register Number:

(a) Write and execute a C program to find the area of a circle

27 (b) Write and execute a C program to print the Transpose of a Matrix

Register Number: 9 6 2 3 2 0 1 0 4 0 2 8

Write and execute a C program to check whether the given number is an Armstrong
(a)
number or not
1
Develop and execute a ‘C’ program to store ‘N’ numbers in an array and print the
(b)
numbers that are divisible by five with the array location.

Register Number: 9 6 2 3 2 0 1 0 4 0 2 9

Develop and execute a ‘C’ program to find the sum of the digits of a given number using
(a)
while statement.
2
(b) Write and execute a C Program to find the roots of the quadratic equation
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM
9 6 2 3 2 0 1 0 4 0 3 0
Register Number:

Given a set of numbers, write and execute a c program to find the sum of weights
based on the following conditions.

(a) • 5 if it is a perfect cube.


• 4 if it is a multiple of 4 and divisible by 6.
5 • 3 if it is a prime number.
Sort the numbers based on the weight in the increasing order
(b) Write and execute a C program to convert the given decimal number into binary
number using user defined function

9 6 2 3 2 0 1 0 4 0 3 1
Register Number:

Write and execute a program in C to display the name of the day, depending upon
(a)
the number entered from the keyboard using switch statement
4
Write and execute a C program to calculate and display the total and average of
(b)
N student marks

Register Number: 9 6 2 3 2 0 1 0 4 0 3 2

(a) Write and execute a C program to find the min and max number in an array

7 (b) Write and execute a C program to convert the given decimal number into hexadecimal
number using user defined function
ANNA UNIVERSITY, CHENNAI – 600 025

B.E/B.Tech DEGREE UNIVERSITY PRACTICAL EXAMINATIONS JULY-2021

College Code / Name : 9623 / Amrita College of Engineering and Technology

Subject Code / Name : CS8261 / C Programming Laboratory

Branch Code/Name : 104/Computer Science and Engineering

Year :I Semester: 02
Date of Exam:30/07/2021 Time: 9.30 AM to 12.30 PM

Register Number: 9 6 2 3 2 0 1 0 4 0 3 3

(a) Write and execute a C program for Matrix subtraction using two dimensional arrays

6 (b) Write and execute a C program to convert the given decimal number into octal number
using user defined function

9 6 2 3 2 0 1 0 4 0 3 4
Register Number:

Write and execute a C program to generate numbers between 1 and 100 which are
(a)
divisible by 2 and are not divisible by 3 and 5.
3
(b) Write and execute a C program for Matrix addition using two dimensional arrays

9 6 2 3 2 0 1 0 4 0 3 5
Register Number:

Develop and execute a ‘C’ program to find the sum of the digits of a given number using
(a)
while statement.
2
(b) Write and execute a C Program to find the roots of the quadratic equation

You might also like