0% found this document useful (0 votes)
44 views21 pages

19AI304-Fundamentals of C-QR - NOV 2023

The document contains questions from 5 units that will be included in a NOV 2023 C programming exam. It includes questions in two formats - short answer/code writing questions worth 2 marks each (Part A), and longer/more complex questions worth 13 marks each that can be answered in paragraph form (Part B). The questions cover a range of C programming topics including data types, operators, conditional statements, loops, arrays, strings, functions, pointers, structures, and dynamic memory allocation. Sample programs/code are included with some questions to help explain the concept being tested.

Uploaded by

vijaysuryavijo
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)
44 views21 pages

19AI304-Fundamentals of C-QR - NOV 2023

The document contains questions from 5 units that will be included in a NOV 2023 C programming exam. It includes questions in two formats - short answer/code writing questions worth 2 marks each (Part A), and longer/more complex questions worth 13 marks each that can be answered in paragraph form (Part B). The questions cover a range of C programming topics including data types, operators, conditional statements, loops, arrays, strings, functions, pointers, structures, and dynamic memory allocation. Sample programs/code are included with some questions to help explain the concept being tested.

Uploaded by

vijaysuryavijo
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/ 21

Question Repository for NOV 2023 Examinations

(PART A – 2 Marks)
UNIT - I
Q. No Questions

1 What are keywords? Give Examples

2 List any 2 rules to be followed while naming the identifier/variable name

Demonstrate the ternary operators with examples.


3

4 Differentiate Compiler and Interpreter

5 Show the output of the following program

#include <stdio.h>
void main ()
{
int m=40, n=30;
if (m == n)
{
printf("m and n are equal");
}
printf("m and n are not equal");
}

Write a program to read only positive integer value from the user and display the value
6
on the monitor.

7 Write a program to find product of two fraction values.

Write a program to find maximum between two integer numbers using conditional
8 operator.

Write a C program to read the age of a person and determine whether the person is
9
eligible for casting the vote using ternary operator

10 Show the output for the below code:

#include <stdio.h>
int main()
{
int num;
scanf("%d", &num);
if(num%6==0)
{
printf("Divisible by 6");
}
else
{
printf("Not Divisible by 6");
}
return 0;
}

UNIT - II
Q. No Questions

1 List out the difference between while and do while statements.

Construct a program to check whether a given number is even or odd.


2

3 Develop code to sum all the prime numbers from 1 to 10 using do while loop.

4 Write short notes on switch statements with its syntax.

5 What are the unconditional control statements in C?


Construct a C Program to print the ASCII value of vowels (A,E,I,O,U) using the switch
6
statement (EX. A-65, E-69)

7
Write a C Program to print 1 to N numbers using While loop

Construct a C Program to print the sum of even numbers from 1 to N using for loop
8

Write a C program to print the following triangular Star pattern using loop
***
9 **
*

Construct a C program to input two numbers from user and find maximum between two
10
numbers using switch case.

UNIT - III
Q. No Questions

1 Define array with examples.


2 Demonstrate two dimensional arrays with examples.

3 Construct a function to swap two numbers.

4 Write a C function for factorial of the given number.

Show the output of the following program.


#include<stdio.h>
#include<string.h>
int main ()
{
5 char str1[20] = "C Program";
char str2[20] = "C Practicals";
printf("%s\n", strcpy(strcat(str1, str2), str2));
return 0;
}

Write a program to read n elements as input and print the second element of the array
6
(integer).

Construct a program to prepare EMI calculation for the sum of 25000, at 8% rate of
7
interest,5 years using function with return type with arguments.
8 Construct a program to count total number of positive elements in an array.

write a program to convert the string ‘PROGRAMMING FUNDAMENTALS’ into


9
lowercase

10 Construct a Program to compare two strings using strcmp ().

UNIT - IV
Q. No Questions

1 What is sorting & List out some of sorting techniques?

2 What is Dynamic memory allocation? List out the library functions.


Show the output of the following program

# include <stdio.h>
void fun(int *ptr)
{
*ptr = 30;
}

3 int main()
{
int y = 20;
fun(&y);
printf("%d", y);
return 0;
}
Show the output of the following program

#include <stdio.h>

void main()

{
4
char *s= "HELLO";

char *p = s;

printf("%c\t%c", *(p + 3),s[1]);

}
5 Define Call by Reference.

6 Explain malloc () with syntax. Give example.

7 Define Call by value. Give example.

How do you free the block of used memory in dynamic memory allocation? Write the
8
syntax and give example.

arr=(int*)malloc(50).
9
Write the code snippet to reallocate the memory as 100 using realloc().

10 Construct a program to add two integer numbers using pointers.


UNIT - V
Q. No Questions

1 Define structure with an example.

2 What is structure variable?

3 How to Declare a structure for storing book information?

4 Differentiate Structure and Union.

5 Define typedef with an example.

6 Explain Enum in C.
7 Explain the need of structure.

8 Create a structure to hold the information of a Laptop(Brand name, Size in inches, price).

Create a C program to print the value of the wednesday using enumeration.


9 enum day {sunday, monday, tuesday, wednesday, thursday, friday, saturday};

Create a C Program to print the list of cable station using enumeration.


10 enum TV { FOX = 11, CNN = 25, ESPN = 15, HBO = 22, MAX = 30, NBC = 32 };

(PART B – 13 Marks - Either Or Type)

UNIT - I
Q. No Questions

1 Explain various data types & Constant in C with examples


Write a program to count the number of digits in the given number .
2

3 Explain various types of Arithmetic, Relational & Logical Operators with Examples.

Construct a program to find greatest of three numbers using ternary operators.


4

5 Explain bitwise operator with examples.

6 Construct a program to generate the first 10 terms of the Fibonacci series.

7 Construct a program to find simple interest & compound interest.

Construct a program to check whether the given year is leap year or not using
8
conditional operator.

Develop a program to find maximum between -700, -850, -650 using conditional
9
operator
10 Develop a program to convert 10 years into days & weeks.

UNIT - II
Q. No Questions

Construct a program to find whether a given number is positive or negative or zero.

Sample Sample Output


1 Input
45 Number is positive
-35 Number is negative
0 Number is equal to
0

2 Summarize various conditional Control statements with examples.

Develop a program to prepare an EB Bill based on following conditions.


3 (First 100 units Rs.2 per unit, unit 101 to 300 Rs 3 per unit, unit 301 to 500 Rs.4 per
unit, above 500 units Rs 5 per unit)

Construct a program to check the input entered by the user is palindrome or not
Sample Input : 11
4
Output: Palindrome Number

Explain the various Looping statements in C?


5
Construct a program to print the numbers ranging from M to N (including M and N
values divisible by 11.
6 Sample input: 20 40 (20 and 40 are included)
Sample Output: 22 33.

7 Construct a Program to print the sum of N numbers which is divisible by 3 and 9.

8 Construct a program to input month number and print the month name using switch
case.
Write a C program to find the eligibility of admission for a professional course based
on the following criteria:
Total in all three subject >=180
9
Marks in Maths >=60
Marks in Phy >=60
Marks in Chem>=60

10 Develop a C program to check whether the given number is perfect square or not.

UNIT - III
Q. No Questions

1 Explain array and its types with examples.


2 Construct a program to find the transpose of the given matrix.

3 Explain function prototypes with proper Examples.

Construct a program to find the factorial of the given number using recursive
4
function.

5 Construct a program to combine the two strings without using built-in functions.

6 Construct a program to compare the two strings without using built-in functions.

Write a C program for a function that accepts x = 89878, y = 73638. Calculate the
7 sum and return the total number of carries.

Construct a C Program to find largest and second largest elements in the given array
8
using sorting.

Write a program to display the value using auto storage class without using looping
9
statements

Construct a C program to sort elements of array in ascending order.


10
UNIT - IV
Q. No Questions

Build a program to perform search operation to find whether the given element is
1
found or not .

Build a program to arrange the following values 56, 34, 23, 64, 12 in ascending
2
order using Selection sorting technique.

3 Explain Pointer with Examples.

4 Construct a program in C to swap two numbers using pointers.

5 Explain in detail on Parameter Passing mechanism with suitable examples.

6 Construct a program to copy a String one to other using Pointers.

Construct a program to count total number of even elements in the following array
7
3,5,32,21,20 using malloc().

write a c program to find sum and average in the range from 14 to 17 using pointer.
9 Construct a program to print the reverse of the string using pointers.

Construct a C program to find area of rectangle using pointer.


10

UNIT - V
Q. No Questions

1 Explain structure with examples.

2 Explain briefly on nested structure with suitable examples.

3 Explain briefly on Self-referential structures with examples.

Construct a program to read (reg-no ,3 subject marks) and store the details of 5
4 students and calculate the Total and Average using union.
Construct a program to read and print a 10 Employee’s Details using array of
5
Structure.

Summarize Union with Examples. Write a Program to print integer, float, character
6
data using union.

7 Create a C program to print 12 months in numbers using enumeration.

Construct a program to read the Details of the 3 courses offered by the college
(course name, department, credits). Suggest a course with the highest credit using
8
Structure.
Example: course suggestion: Data Science, AI&DS, 6
Construct a C program to find the given date lies in the leap year or not using
9 structure. Create a structure Date (day, month, year).

10 Demonstrate Typedef in structure with suitable coding snippet.

(PART C – 15 Marks - Either Or Type)

UNIT - I
Q. No Questions

Construct a program to calculate total, average and percentage of five subjects


1
without using array.
Construct a C program to read the student marks and print the which class he/she
got.

marks>=70 print FIRST CLASS WITH DISTINCTION


2 60>= marks <70 print FIRST CLASS
50>= marks <60 print SECOND CLASS
40>= marks <50 print THIRD CLASS
marks<40 print U r Failed...Better luck next time

3 Construct a program to swap two numbers using bit-wise operator.

(i) Develop a C program to input a number from the user and check whether the
number is positive, negative or zero using a switch case. (6)

(ii) Read M & N as inputs from the user to specify the range. Construct a C Program
to
4
print the sum of numbers within the given range. (7)
Constraints:
1<=M<=100
1<=N<=100
and N>M.

UNIT - II
Q. No Questions
1 Develop a C program to print the pascal’s triangle pattern

1
11
121
1331
14641
1 5 10 10 5 1
1 6 15 20 15 6 1

2 Construct a menu-based program to find the area of different shapes (triangle,


rectangle, circle & Square) using switch statements.

Construct a C program for this following pattern:


1
24
3
135
2468
13579
Construct a C program for this following pattern:
AAAAA
AAAAA
4
AAAAA
AAAAA
AAAAA

UNIT - III
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

Build a program to find the number of vowels, consonants, Special Characters and
1 CO3 K6 3
white spaces in a given text.

Build a Menu-driven program to count the numbers which are divisible by 3, 5 and
2 CO3 K6 3
by both.(passing an array to a function)
3 Construct a program to find sum of digits using recursion. CO3 K3 3

(i) Construct a C program to calculate the power for 8,4 using recursion.
4 (ii) Write a program to print odd/even numbers in given range based on lower limit CO3 K3 3
value/starting value using recursion.

UNIT - IV
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

Build a program to arrange the following values 100,300,50,30,89,201 in ascending


1 CO4 K6 4
order using Insertion sorting technique.

Construct a program to count the total number of even elements in an array using
2 Dynamic Memory Allocation. CO4 K3 4

(i) Develop a C program to add value 12 to list which already have 10 in that using

3 realloc () and print that value. CO4 K3 4


(ii) Write a 'C' program to reverse a float array's elements using dynamic memory
allocation.
(i)Write a program in C to print the elements of an array in reverse order using
pointer.
4 (ii) Construct a C program to count total number of even elements in an array using CO4 K3 4
calloc ().
UNIT - V
Knowledge
Difficulty
Q. No Questions CO Level
Level (1-5)
(Blooms)

Construct a program to add two distances in inch –feet system using structure.
1 CO5 K3 4
(12 inches= 1 feet)

Build a structure for Electricity Bill (use service no, name, previous reading, current
reading, unit consumption & amount as data members)
2 CO5 K6 4
(units<=100 per unit Rs.2.00, units>100 and unit<=300 Rs=3.00 per unit, above 300
units Rs.5.00 per unit)

Build a structure program to read (empno, dept & basic pay) and store the data of 3
3 employees and calculate their Gross Salary (da =10% and HRA=30% from BP) CO5 K6 4
using nested structures.

(i) Construct a C program to store the data of different type & retrieve them using
union. (8)
4 CO5 K3 4
(ii) Write a program to display the class timings using enumeration.
(like first hour=8 am. fifth hour=12 pm)(7)

You might also like