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

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 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