0% found this document useful (0 votes)
12 views8 pages

CU-2021 B.Sc. (General) Mathematics Semester-3 Paper-SEC-A QP

This document contains a mathematics exam paper with multiple choice and numerical questions testing knowledge of C programming concepts and functions. 1) The first section contains 10 multiple choice questions testing understanding of C programming concepts like loops, arrays, functions and their outputs. 2) The second section asks students to write a C program to input and compare two numbers and output their sum, difference or equality. 3) The third section asks students to write a C program that inputs a number and checks if it is divisible by 11, outputting the number if not.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

CU-2021 B.Sc. (General) Mathematics Semester-3 Paper-SEC-A QP

This document contains a mathematics exam paper with multiple choice and numerical questions testing knowledge of C programming concepts and functions. 1) The first section contains 10 multiple choice questions testing understanding of C programming concepts like loops, arrays, functions and their outputs. 2) The second section asks students to write a C program to input and compare two numbers and output their sum, difference or equality. 3) The third section asks students to write a C program that inputs a number and checks if it is divisible by 11, outputting the number if not.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

(1) V(3rd Sm.

)-Mathematics-G/SEC-A/CBCS

2021
MATHEMATICS — GENERAL
Paper : SEC-A
(C-Programming Language)

Full Marks : 80
Candidates are required to give their answers in their own words
as far as practicable.

õ∂±ôLø˘ø‡Ó¬ ¸—‡…±&ø˘ ¬Û”Ì«˜±Ú øÚÀ«˙fl¬/


1 Ú— õ∂ùü ¤ı— ’¬Ûı˛ Œ˚-Œfl¬±ÀÚ± Â˚˛øÈ¬ õ∂Àùüı˛ ά◊Mı˛ ±›/

1/ ÚœÀ‰¬ı˛ õ∂ùü&ø˘ı˛ õ∂øÓ¬øÈ¬ ŒÔÀfl¬ ¸øÍ¬fl¬ øıfl¬äøÈ¬ ˚≈øMê¸˝fl¬±Àı˛ øÚı«±‰¬Ú fl¬Àı˛± – 2×10
ïfl¬ó 4-¤ı˛ ‚Ú øÚÌ«À˚˛ı˛ ¸øÍ¬fl¬ statement øÈ¬ ˝˘
ï’ó pow(3, 4) ï’±ó pow(4, 3)
ï˝◊ó pow(4, 1 ) ï÷ó pow 3(4)
3
ï‡ó ÚœÀ‰¬ı˛ Œfl¬±ÚƒøÈ¬ ¸Ó¬… Ú˚˛∑
ï’ó Array ˝˘ ’±˘±± data type-¤ı˛ ¸˜ø©Ü
ï’±ó Array ά◊¬Û±±Ú&ø˘ ˝˘ ’Ú≈Sêø˜fl¬ (sequential) Œ˜˜øı˛ ’ı¶ö±Ú
ï˝◊ó ά◊¬Û±±Ú ı…øÓ¬Àı˛Àfl¬ array Œ‚±¯Ì± ˚ø fl¬Àı˛± ά◊¬Û±±Ú&ø˘ÀÓ¬ garbage value set ˝Àı
ï÷ó Array-ı˛ ά◊¬Û±±Ú&ø˘ ¤fl¬˝◊ Ú±˜ ˆ¬±· fl¬Àı˛/

ï·ó ÚœÀ‰¬ı˛ for loop-¤ ˚ø SnøÈ¬ Ô±Àfl¬ Œıı˛ fl¬Àı˛± –


:
int k=4;
for(;;);
printf(”%d”, k++);
if(k >30)
break;
:
ï’ó ≈øÈ¬ semicolon ı…ı˝±ı˛ fl¬ı˛± ά◊ø‰¬Ó¬ Ú˚˛
ï’±ó for loop-¤ øfl¬Â≈ ˙Ó«¬ ı…ı˝±ı˛ fl¬ı˛± ά◊ø‰¬Ó¬
ï˝◊ó loop-¤ı˛ ˜ÀÒ… fl¬˜¬ÛÀé¬ ¤fl¬øÈ¬ statement Ô±fl¬± ά◊ø‰¬Ó¬
ï÷ó Œfl¬±Ú SnøÈ¬ ŒÚ˝◊/

Please Turn Over


V(3rd Sm.)-Mathematics-G/SEC-A/CBCS (2)
ï‚ó ÚœÀ‰¬ı˛ Œõ∂±¢∂±˜øÈ¬ı˛ ’±Î¬◊Ȭ¬Û≈Ȭ fl¬œ∑
#include<stdio.h>
int abc(int x,int k)
{
if(k==0)
return 1;
else return (x*abc(x,k-1));
}
void main()
{
printf(”%d”,abc(3,2));
}
ï’ó 6 ï’±ó 1
ï˝◊ó 5 ï÷ó 9
ï„ó Switch()-¤ õ∂ÀÓ¬…fl¬ case statement ’±˘±± ˝˚˛
ï’ó break Z±ı˛± ï’±ó continue Z±ı˛±
ï˝◊ó exit() Z±ı˛± ï÷ó goto Z±ı˛±/
ó ¤fl¬˜±S ˆ¬±¯± ˚± fl¬ø•Ûά◊Ȭ±ı˛ Œı±ÀÁ¬–
ï’ó ’…±À¸•§ø˘ ˆ¬±¯± ï’±ó ı±˝◊Ú±øı˛ ˆ¬±¯±
ï˝◊ó C-ˆ¬±¯± ï÷ó Œıø¸fl¬ ˆ¬±¯±/
ïÂó øÚ•ßø˘ø‡Ó¬ Œõ∂±¢∂±˜øÈ¬ı˛ ’±Î¬◊Ȭ¬Û≈Ȭ fl¬Ó¬∑
#include<stdio.h>
main()
{
int n=5;
printf("output=%d",(n/2));
}
ï’ó 0 ï’±ó 3
ï˝◊ó 2 ï÷ó 2.5
ïÊó øÚ•ßø˘ø‡Ó¬ Œõ∂±¢∂±˜øÈ¬ fl¬Ó¬ı±ı˛ ‰¬±˘±ÀÚ± ˝Àı∑
#include<stdio.h>
main()
{
int n;
for (n=1;n<10;n++)
printf("MATHEMATICS");
}
ï’ó 8 ï’±ó 9
ï˝◊ó 10 ï÷ó 11
(3) V(3rd Sm.)-Mathematics-G/SEC-A/CBCS

ïÁ¬ó øÚ•ßø˘ø‡Ó¬ C-Œfl¬±Àάı˛ ’±Î¬◊Ȭ¬Û≈Ȭ fl¬Ó¬ ˝Àı∑


#include<stdio.h>
int main()
{
int x[4]={7,8,9,10};
int p[4];
p=x;
printf("%d\n", p[2]);
}
ï’ó 8 ï’±ó Compile time error
ï˝◊ó 2 ï÷ó ¤&ø˘ı˛ Œfl¬±ÀÚ±øÈ¬˝◊ Ú˚˛/
ï¤ûó øZ-˜±øSfl¬ ’…±Àı˛ øııı˛ÀÌı˛ ¸øÍ¬fl¬ ά◊¬Û±˚˛ fl¬œ∑
ï’ó int[][]arr; ï’±ó int arr [][];
ï˝◊ó int[]arr[]; ï÷ó ¤&ø˘ı˛ Œfl¬±ÀÚ±øÈ¬˝◊ Ú˚˛/

2/ ïfl¬ó C-ŒÓ¬ loop fl¬œ∑ ¤øÈ¬ Œõ∂±¢∂±À˜ fl¬œ õ∂À˚˛±ÊÚ ˝˚˛∑ While ¤ı— C loop &ø˘ı˛ ¬Û±Ô«fl¬… ’±À˘±‰¬Ú± fl¬Àı˛±/
ï‡ó ¤fl¬øÈ¬ C-Œõ∂±¢∂±˜ Œ˘À‡± ˚± ≈øÈ¬ ¬Û”Ì«¸—‡…± m ¤ı— n, input ø˝¸±Àı ¢∂˝Ì fl¬ı˛Àı/ ˚ø m, n-¤ı˛ Œ‰¬À˚˛ ŒÂ±È¬ ˝˚˛, Ó¬±Àı˛
Œ˚±·Ù¬˘ ˜≈^Ììõ∂˙«Ú fl¬Àı˛±/ ˚ø n, m-¤ı˛ Œ‰¬À˚˛ ŒÂ±È¬ ˝˚˛, Ó¬±Àı˛ Ó¬Ù¬±Ó¬ (difference) ˜≈^Ììõ∂˙«Ú fl¬Àı˛±/ ˚ø ά◊ˆ¬À˚˛˝◊
¸˜±Ú ˝˚˛, equal ı±Ó«¬±øÈ¬ ˜≈^Ììõ∂˙«Ú fl¬Àı˛±/ ï1+2+2ó+5

3/ ïfl¬ó ¤fl¬øÈ¬ Œõ∂±¢∂±˜ Œ˘À‡± ˚± ¤fl¬øÈ¬ ¬Û”Ì«¸—‡…± ¢∂˝Ì fl¬Àı˛ ¤ı— Ó¬± 11 Z±ı˛± øıˆ¬±Ê… øfl¬Ú± øÚÒ«±øı˛Ó¬ fl¬Àı˛±/ ˚ø øıˆ¬±Ê… Ú±
˝˚˛, Ó¬Àı 11 Z±ı˛± øıˆ¬±Ê… øÚfl¬È¬Ó¬˜ ¬Û”Ì«¸—‡…± Œıı˛ fl¬Àı˛/
ï‡ó .c, .obj ¤ı— .exe file ¸•x¸±ı˛Ì&ø˘ fl¬œ ø‰¬ø˝êÓ¬ fl¬Àı˛ ¤ı— fl¬‡Ú ¤&ø˘ ΔÓ¬øı˛ ˝˚˛∑ 5+ 5

4/ ïfl¬ó 2+4+2+4+2+... series-¤ı˛ õ∂Ô˜ nøÈ¬ ¬ÛÀı˛ Œ˚±·Ù¬˘ øÚÌ«À˚˛ı˛ ÊÚ… ¤fl¬øÈ¬ C Œõ∂±¢∂±˜ Œ˘À‡±/
ï‡ó ˚Ô±˚Ô ˚≈øMê øÀ˚˛ ÚœÀ‰¬ı˛ Œõ∂±¢∂±˜øÈ¬ı˛ Ù¬˘±Ù¬˘ (output) Œ˘À‡± –
#include<stdio.h>
void main()
{
int a;
a=4*8%5;
printf(”a=%d”,a);
} 7+3

Please Turn Over


V(3rd Sm.)-Mathematics-G/SEC-A/CBCS (4)

5/ ïfl¬ó Ù¬±—˙Ú ı…ı˝±Àı˛ı˛ øÓ¬ÚøÈ¬ ¸≈øıÒ± Œ˘À‡±/ user-defined function ¤ı— standard built-in function-¤ı˛ ˜ÀÒ… ¬Û±Ô«fl¬…
øÚı˛+¬ÛÌ fl¬Àı˛±/
ï‡ó ¤fl¬øÈ¬ Œõ∂±¢∂±˜ Œ˘À‡± ˚± ¤fl¬øÈ¬ N ¬ÛÀı˛ Ó¬±ø˘fl¬± ŒÔÀfl¬ øZÓ¬œ˚˛ ı‘˝M˜ ¸—‡…± øÚÌ«˚˛ fl¬Àı˛/ 5+5

6/ ¸—øé¬l ŒÚ±È¬ Œ˘À‡± –


ïfl¬ó printf() › scanf() ’À¬Ûé¬fl¬ (functions)
ï‡ó Scanf() ı…ı˝±ı˛ fl¬Àı˛ a, b, c ı±Uøıø˙©Ü ¤fl¬øÈ¬ øSˆ≈¬ÀÊı˛ Œé¬SÙ¬˘ øÚÌ«À˚˛ı˛ ÊÚ… ¤fl¬øÈ¬ C-Œõ∂±¢∂±˜ Œ˘À‡±/
2+3+5

7/ ïfl¬ó øÚ•ßø˘ø‡Ó¬ Ù¬±—˙Ú&ø˘ı˛ ÊÚ… C-¤'Àõ∂˙Ú Œ˘À‡± –

ï’ó 2 x
3
sin x
 log 1  sin x

 
ï’±ó sin 1  x3  2 tan 1  x 2  
ï‡ó õ∂Ô˜ 100 ¶§±ˆ¬±øıfl¬ ¸—‡…±ı˛ ıÀ·«ı˛ Œ˚±·Ù¬˘ øÚÌ«À˚˛ı˛ ÊÚ… for loop ı…ı˝±ı˛ fl¬Àı˛ ¤fl¬øÈ¬ C-Œõ∂±¢∂±˜ Œ˘À‡±/
ï·ó øZ‚±Ó¬ ¸˜œfl¬ı˛ÀÌı˛ ıœÊ øÚÌ«À˚˛ı˛ ¸—ø˙v©Ü flow chart ı˛‰¬Ú± fl¬Àı˛±/ ï2+1ó+4+3

8/ ïfl¬ó ≈øÈ¬ ÒÚ±Rfl¬ ¬Û”Ì« ¸—‡…±ı˛ ˘.¸±.&. øÚÌ«À˚˛ı˛ ÊÚ… ¤fl¬øÈ¬ algorithm Œ˘À‡± ¤ı— ¸—ø˙v©Ü flow chart ’Ç¬Ú fl¬Àı˛±/
ï‡ó Ȭœfl¬± Œ˘À‡± –
ï’ó RAM
ï’±ó ROM [ï3 + 3ó + ï2 + 2ó]

9/ ïfl¬ó ¤fl¬˜±øSfl¬ array fl¬œ∑ ά◊±˝ı˛Ì ±›/


ï‡ó ı±ô¶ı ¸—‡…±ı˛ ¤fl¬øÈ¬ Set-¤ı˛ ¸¸…&ø˘Àfl¬ Sê˜˝ò±¸˜±Ú (decreasing) ’±fl¬±Àı˛ ¸±Ê±ÀÚ±ı˛ ÊÚ… array-øıı‘øÓ¬ ı…ı˝±ı˛
fl¬Àı˛ ¤fl¬øÈ¬ C-Œõ∂±¢∂±˜ Œ˘À‡±/ ï2+ 2ó + 6

10/ ïfl¬ó Break ¤ı— Continue-¤ı˛ ˜ÀÒ… ¬Û±Ô«fl¬… fl¬œ∑


ï‡ó Break-øıı‘øÓ¬Àfl¬ fl¬œˆ¬±Àı for loop-¤ı˛ ˜ÀÒ… ø‰¬øSÓ¬ fl¬ı˛± ˚±˚˛ Ó¬±ı˛ ÊÚ… ¤fl¬øÈ¬ C-Œõ∂±¢∂±˜ Œ˘À‡±/
ï·ó ¤fl¬øÈ¬ Œ·±˘Àfl¬ı˛ ’±˚˛Ó¬Ú øÚÌ«À˚˛ı˛ ÊÚ… ¤fl¬øÈ¬ C-Œõ∂±¢∂±˜ Œ˘À‡±, Œ˚‡±ÀÚ Œ·±˘Àfl¬ı˛ ı…±¸±Ò« r/ 3+ 3+ 4

11/ ïfl¬ó C-ŒÓ¬ function ¤ı— recursion-¤ı˛ ¬Û±Ô«fl¬… fl¬œ∑


ï‡ó ¤fl¬øÈ¬ function ı˛‰¬Ú± fl¬Àı˛± ¤fl¬øÈ¬ ¸—‡…±ı˛ factorial-¤ı˛ ˜±Ú øÚÌ«À˚˛ı˛ ÊÚ…/
ï·ó C-ŒÓ¬ Branching øıı‘øÓ¬ ¸•§Àg¬ Ȭœfl¬± Œ˘À‡±/ 3+ 4+ 3
(5) V(3rd Sm.)-Mathematics-G/SEC-A/CBCS

[English Version]
The figures in the margin indicate full marks.
Answer Question No. 1 and any six from the rest.

1. Choose the correct alternative: 2×10


(a) What is the correct statement for finding cube of 4?
(i) pow(3, 4) (ii) pow(4, 3)
(iii) pow(4, 1 ) (iv) pow 3(4)
3
(b) Which of the following is NOT TRUE?
(i) An array is a collection of different data types
(ii) Array elements are stored in sequential memory location
(iii) If you declare array without stating the elements it will be set to garbage value
(iv) All the elements of an array share the same name.
(c) Point out the error, if any, in the for loop given below:
:
int k=4;
for(;;);
printf(”%d”, k++);
if(k >30)
break;
:
(i) The two semicolons should not be used
(ii) Some condition should be used in the for-loop
(iii) There should be at least one statement in the body of the loop
(iv) No error is present.
(d) What is the output of the following program?
#include<stdio.h>
int abc(int x,int k)
{
if(k==0)
return 1;
else return (x*abc(x,k-1));
}
void main()
{
printf(”%d”,abc(3,2));
}
(i) 6 (ii) 1
(iii) 5 (iv) 9

Please Turn Over


V(3rd Sm.)-Mathematics-G/SEC-A/CBCS (6)

(e) Each case statement in switch() is seperated by


(i) break (ii) continue
(iii) exit() (iv) goto.
(f) The only language which the computer understands is
(i) Assembly Language (ii) Binary Language
(iii) C-Language (iv) BASIC Language.
(g) What will be the output of the following program?
#include<stdio.h>
main()
{
int n=5;
printf("output=%d",(n/2));
}
(i) 0 (ii) 3
(iii) 2 (iv) 2.5
(h) How many times the following program will run?
#include<stdio.h>
main()
{
int n;
for (n=1; n<10; n++)
printf("MATHEMATICS");
}
(i) 8 (ii) 9
(iii) 10 (iv) 11
(i) What will be the output of the following C-Code?
#include<stdio.h>
int main()
{
int x[4]={7,8,9,10};
int p[4];
p=x;
printf("%d\n",p[2]);
}
(i) 8 (ii) Compile time error
(iii) 2 (iv) None of these.
(7) V(3rd Sm.)-Mathematics-G/SEC-A/CBCS

(j) The correct way to declare a two-dimensional array in C is

(i) int[][]arr; (ii) int arr [][];

(iii) int[]arr[]; (iv) None of these.

2. (a) What is a loop in C? Why is it necessary in a program? Discuss the differences between while and
for loops in C.

(b) Write a C-program which reads two integer values m and n. If m is less than n, display their sum.
If n is less than m, display their difference. If both are equal, display the message equal.
(2+3)+5

3. (a) Write a program that reads an integer number and determine whether it is divisible by 11 or not. If
not, then finds the nearest integer divisible by 11.

(b) What do the file extensions .c, .obj and .exe stands for and when are they created? 5+5

4. (a) Write a program in C to compute sum of the first n terms of the series:
2+4+2+4+2+...

(b) Find the output of the following program by giving appropriate explanation.
#include<stdio.h>
void main()
{
int a;
a=4*8%5;
printf(”a=%d”,a);
} 7+3

5. (a) Write three benefits of using functions. Distinguish between the user-defined function and the standard
build-in functions.

(b) Write a program that finds the second largest element in a given list of N elements. 5+5

6. (a) Write short notes on:


The printf() and scanf()functions

(b) Write a C-program to find the area of a triangle having three sides a, b, c using scanf().
2+3+5

Please Turn Over


V(3rd Sm.)-Mathematics-G/SEC-A/CBCS (8)

7. (a) Write the following expressions in C:


(i) 2 x sin x  log 1  sin x
3

 3
 
(ii) sin 1  x  2 tan 1  x
2

(b) Using for-loop, write a C-program to find sum of the squares of first 100 natural numbers.
(c) Draw the flow chart corresponding to the algorithm to find the roots of a quadratic equation.
(2+1)+4+3

8. (a) Write an algorithm and draw the corresponding flow chart to find LCM of two positive integers.
(b) Write short notes on:
(i) RAM
(ii) ROM [(3+3)+(2+2)]

9. (a) What is one dimensional array? Give an example.


(b) Using array statement, write a C-program to arrange a set of real numbers in decreasing order.
(2+2)+6
10. (a) Distinguish between Break and Continue.
(b) Write a C-program to illustrate the break statement in a for-loop.
(c) Write a C-program to find the volume of a sphere of radius r. 3+3+4

11. (a) What is the difference between function and recursion in C-language?
(b) Write a function to carry out the task of computing the factorial of a number.
(c) Write a short note on Branching Statement in C. 3+4+3

You might also like