0% found this document useful (0 votes)
67 views4 pages

The Figure in The Margin Indicate Full Marks Candidates Are Required To Give Their Answers in Their Own Words As Far As Practicable

This document contains 9 questions related to C programming. Candidates are required to answer question 1 fully and any 4 other questions. Question 1 has 7 short questions related to programming concepts in C like break, continue, strcmp(), call by reference, switch statements, ternary operators, and example code outputs. The other questions ask about differences between macros and functions, function prototypes, recursion vs iteration with a recursive factorial example, differences between arrays and structures with examples, passing arrays to functions, representing strings with arrays of pointers, differences between pointer and array definitions, differences between structures and unions with examples, purpose of extern variables, reversing a string without functions, checking if a matrix is an identity matrix, using fseek() and

Uploaded by

Ln Amitav Biswas
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)
67 views4 pages

The Figure in The Margin Indicate Full Marks Candidates Are Required To Give Their Answers in Their Own Words As Far As Practicable

This document contains 9 questions related to C programming. Candidates are required to answer question 1 fully and any 4 other questions. Question 1 has 7 short questions related to programming concepts in C like break, continue, strcmp(), call by reference, switch statements, ternary operators, and example code outputs. The other questions ask about differences between macros and functions, function prototypes, recursion vs iteration with a recursive factorial example, differences between arrays and structures with examples, passing arrays to functions, representing strings with arrays of pointers, differences between pointer and array definitions, differences between structures and unions with examples, purpose of extern variables, reversing a string without functions, checking if a matrix is an identity matrix, using fseek() and

Uploaded by

Ln Amitav Biswas
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/ 4

Behala College

CMSA
CC-2
Full Marks-30

The figure in the margin indicate full marks


Candidates are required to give their answers in their own words as far as practicable

Answer Question No. 1 and any four from the rest

1. Answer any four questions 1.5*4

(a)Explain the usage of break and continue in C programs.

(b)What is the function of strcmp () in C language?

(c) What do you mean by call by reference?

(d) When is a switch statement better than multiple if statements?

(e) What is ternary operator in C language?

(f)what will be the output?

#include<stdio.h>

void main()

{
char *p=”UNIVERSITY”

printf(“%c”,++*(p++));

getch();

}
(g).what will be the output of the following code

#include<stdio.h>

void main()

{
char str[]=”COMPUTER”

int i=0;

n=strlen(str);

while(n)

n--;

str[i]=str[n];

i++;

printf(“%s”,str);

2. (a) Distinguish macro and functions

(b) What is the purpose of using function prototype? 4+2


3.(a)What is the difference between recursion and iteration.

(b) Write a program code in C language to find out factorial of a given number
using recursion 2+4

4.(a) How is a structure is different from array .Illustrate with example.

(b) If an array is passed to a function and some of its elements are modified by
the function, are these alterations be identified in the parent program? Explain.

3+3

5.(a)How can a one-dimensional array of pointers be used to represent a


collection of strings. Explain with suitable example

(b) Given the following

char *city=”Madras”;

char city [10] =”Madras”;

How do the above definitions differ? Explain clearly 3+3

6) a)Write down the differences between structure and union with suitable
example.

(b) What is the purpose of extern variable? 4+2

7)(a)Write a program code in C language to reverse a string without using

library function. 6

8) Write a program code in C language to check whether a matrix is identity


matrix or not. 6
9)(a) How to use the function of fseek() and ftell()

(b) Write short notes on Enumerated data types in C. Give example.

(1.5+1.5)+3

You might also like