0% found this document useful (0 votes)
131 views

Programing in C

Uploaded by

rinatambade860
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views

Programing in C

Uploaded by

rinatambade860
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Scheme – G

Sample Test Paper-I

Course Name : Computer Engineering Group


Course Code : CO/CD/CM/CW/IF
Semester : Second
17212
Subject Tile : Programming in ‘C’
Marks : 25 Time:1 Hrs.

Instructions:
1. All questions are compulsory.
2. Illustrate your answers with neat sketches wherever necessary.
3. Figures to the right indicate full marks.
4. Assume suitable data if necessary.
5. Preferably, write the answers in sequential order.

Q1. Attempt any THREE 09 Marks


a) State four relational operators with meaning.
b) State the use of break statement.
c) What is constant? Give any two examples.
d) Write a c program to accept any two numbers and display the addition of them.

Q2. Attempt any TWO 08 Marks


a) State four rules for choosing variable name?
b) Describe if-else ladder with example.
c) State the arithmetic and Logical operators with their meaning.

Q.3 Attempt any TWO 08 Marks


a) Write a program to find largest of three numbers.
b) What is the standard Input/output header file used in ’C’ Program.
c) Illustrate the working of do-while loop with example.

1
Scheme – G

Sample Test Paper-II

Course Name : Computer Engineering Group


Course Code : CO/CD/CM/CW/IF
Semester : Second
17212
Subject Tile : Programming in ‘C’
Marks : 25 Time:1 Hrs.
Instructions:
1. All questions are compulsory.
2. Illustrate your answers with neat sketches wherever necessary.
3. Figures to the right indicate full marks.
4. Assume suitable data if necessary.
5. Preferably, write the answers in sequential order.

Q.1 Attempt any THREE 09 Marks


a) Declare One Dimensional, 5 elements integer array and initialize all values.
b) Give the meaning of declaration:
int *ptr;
c) State any four string handling functions.
d) What is recursive function?

Q.2 Attempt Any TWO 08 Marks


a) Write the declaration and initialization of Two-Dimensional array with example.
b) Write a function to exchange the values of two variables say x and y. Assume x and y are
defined as global variables.
c) Describe No arguments and No return value category of function with example.

Q3 Attempt any TWO 08 Marks


a) List different pointer arithmetic operations. Explain any one of them?
b) What is structure and array of structure?
Declare structure student with elements roll_no and name. Declare array of structure of 10
students.
c) Write a program to print reverse of entered string using pointer.

2
Scheme – G

Sample Question Paper

Course Name : Computer Engineering Group


Course Code : CO/CD/CM/CW/IF
Semester : Second
17212
Subject Tile : Programming in ‘C’
Marks : 100 Time:3 Hrs.
Instructions:
1. All questions are compulsory.
2. Illustrate your answers with neat sketches wherever necessary.
3. Figures to the right indicate full marks.
4. Assume suitable data if necessary.
5. Preferably, write the answers in sequential order.

Q.1 Attempt any TEN of the following: 20 Marks


a) State four Arithmetic operators and four Logical operators.
b) State different basic data type in ‘C’.
c) Write the syntax of If-Else Statement.
d) State use of break statement.
e) Give the syntax for strcpy() string function.
f) Write output of the following program.
void main()
{
char str[5]={‘a’,’b’,’c’,’d’,’e’,’/’};
printf(“%s”,str);
}
g) Write the syntax for declaring structure.
h) What is function prototype? Give one example of function prototype.
i) Given the following declarations:
int x=10,y=10;
int *p1=&x, *p2=&y;
What is the value of following expression?
(a) (*p1)++
j) What would be output of following code segment?
int count =5

3
while (count-- >0)
print (count); print (“%”, count);
k) Define token? List tokens in ’C’.
l) Distinguish between while and do-while loop [Any two points]

Q.2 Attempt any FOUR of the following. 16 Marks


a) Enlist different format specifiers.
b) Distinguish between variable and constant.
c) How if-else is replaced using conditional operator? State with example.
d) Draw the structure of C program with suitable example.
e) Write syntax of switch case statement with syntax and give suitable example.
f) Write continue statement with example.

Q.3 Attempt any FOUR of the following. 16 Marks


a) Write a program to reverse given integer number(input =2356 reverse is 6532)
b) Find out the errors in the following program component and justify the same:
float i;
int p=0;
for (i=0;i =10; i+=2)
{
p=i*2;
printf(“%d”,i,p);
}
c) State the use of increment and decrement operators. Also give the difference between i++
and ++I state with example.
d) State with example, the conditions in which else-if ladder is used.
e) Write a ‘C’ program to accept any integer number and print whether it is even or odd.
f) Write a program to find the sum of odd numbers between1 to 20.

Q.4 Attempt any FOUR of the following. 16 Marks


a) Write a program to determine the String is Palindrome. (E.g. “madam” reverse “madam” .If
both are equal then String is Palindrome)
b) What is character Array? Describe with example
c) Write a program to read two Strings and compare them using strcmp() Function and print a
message accordingly.

4
d) Describe category of function: function with No arguments and No return value with
example
e) What is a Structure? How is it different from an Array?
f) Write the syntax of function declaration? State the example of it.

Q.5 Attempt any FOUR of the following. 16 Marks


a) Write a program to accept five integer elements in array and print Odd Numbers in them
b) Define 2-D array. State syntax to declare and initialize two dimensional arrays with
example.
c) Distinguish between Call by Value and Call by Reference methods for calling function.
d) Write a function to exchange the value of variables say x and y.
e) Write p program to define a structure employee with members emp_name , emp_id and
salary. Accept data for one employee and display it.
f) Write a function to find the product (multiplication) of two numbers.

Q.6 Attempt any FOUR of the following. 16 Marks


a) Write a program to calculate factorial of given number using recursion.
b) Define pointer. Describe & (ampersand) and *(asterisk) operators in pointers.
c) State the meaning of following statements with reference to the pointers

int *ptr ,m=8;


*ptr =m;
ptr =&m;
d) Write a program in C using pointers to determine length of the string.
e) List different pointer arithmetic operations and give example of each.
f) How pointers are used in Call By Reference method for functions ?

You might also like