Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
18 views

Statistical Computing: Ustng C/ C++ Programming

C++

Uploaded by

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

Statistical Computing: Ustng C/ C++ Programming

C++

Uploaded by

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

Total number of printed pages-8

3(Sem-5/CBCS)STA HC 2

2022

STATISTICS

(Honours )
Paper : STA-HC-5026
( Statistical Computing
ustng C/C++ Programming)
Full Marks : 60
Time : Three hours

The flgures in the margin indicate


full marks for the questions.

1. Answer any seven questions from the


following : 1x7=7

(a) Use of more than one main () function


in a C programme is illegal.
(State True or False)
(b) is a sequence of instructions
written to performn a specific task in
the compute (Fill in the blank)

Contd.
(Sem-5/CBCS) 3
(r (g) ) (e) (d) (c)
expression. theif t Use To (iv) (ui) = (i!= Which?
) operator they All What comma (w) (i) colon(i)
semicolon Every
with
end a
STA 1s print
an None % variables dot
HC are is
2/G error
the of
a
programme
of the used
data scanf
2 to (Choose
in the following must (Choose
place
the left in
(State above (State the function
field
justiied,
a(Fill the
be statement
programnme.
isinitialized the
semicolon
True anTrue
specification. in correct correct
?
the assignment
or we or in
False) afterblank) mustoption) False) before option)
must C

3 2.
m-5/CBCS)
(c) (b) Answer:
(a)briefly () (k) i) (i)

in Define write
Write
available declared
illegal. Theprogramme.
the An (i) program
(i) ?be What
Which
(iv) goto(üi)
STA
any following used
printf(%d",
declaration N[3); array Both break exit()
HC
down global about of is
2/G four tothe an
and ()
N[3]={1,
What (Choose and immediately algorithm
C.
variable CPU. following
3 the of statement
the initialized
relational (State int will (i)
following
and x be 2, the statements
?
(2]={1, ? 3} exit
True the correct
local
has
operators questions or 2, output in from
variable. option)
2x4=8 False) 3}; beena
Contd. the can
is of C
3
m-5/CBCS) 3.

Explain
the(a) Answer
following : (h) (g) (e) (d)
statement Briefly assuming
(i) Evaluate
(i) character
readingWhat () Write afterWhat
expressions
(ii)expressions
STA Consider
any
HC k=2*3/4
describe
k= are X+y -9x+4
+
z 3x execution wil mt+;y=m=
down
8;
2/G 3/2 C+d
with three that the a
in the the
be
+4 character C
functions ofthe
4
the the +following
+
programming
k the ofthe following
IF...ELSE'
nestedquestions 3/8 is equivalent the
help simple 4/4 a arithmetic given values
+ float and you
of 8-2
IF expressions of
statements:
a variable will statements C
flowchart. statement. +5/8
from writing
? m
5x3=15 use and
the : for
a ? y

3
m-5/CBCS)
(h) (g) (e) (d) ) (c) (b)

payer theDraw IT IT asThe DiscussC/C++.


one-dimensional
ITfollows DescribeExplain (i) deviationWrite
integerWrite
STA = = =
income 20,000/- 20% if 10% 0
income declaration
variablesabout
Write
C/C++. in Explain
statement
HC as 3,00,000/- if briefly an
a income numbers
2/G flowchart of of initializationof the algorithm
per the the how of
if
tax incomeincome tax DO briefly n
5 the income is to on
s below rates available observations.
income array jump
statementC/C++. of input
in
above to to
which
be above 3,00,000/
above the
C/C++.
5,00,000/ 3,00,000/ find
< of out'
in WHILE and
rule.paidbya5,00,000/-
5,00,000/ countryare a in the
would
print C/C++. of C/C++. output standard
a
Contd.
loop
+
tax in 2 of 3 of
4.
m-5/CBCS) 3
(b) following
(a) ) :
(a) (c) ) Answer

(i) ) (i) (ü) (i) (u) (i)


STA of
C.
State array. Write
two-dimensional
initialization
HC of
on
Write Write
findYoperators in
C. given,
to
the
If Write ExplainElaborate
as operator
Write any
find one
2/G the three
X three a a
thewrite
the a a a of
and brief note
statement
6 noteregressionC/C++ detail the briefly on
importance a
area sides
on
X
on note C/C++ note loop on questions
the
of of FOR the basic
declarationprogramming
Y.
on the a
on
available
structure.
coefficients programming triangleflowchart.statement'conditional
of arithmetic triangle. structure10x3=30from
C. in
2+2=4 the
and are 6 3 2 C. 5
6 of to 4 4
2

m-5/CBCS) 3
(e) )

(üi) briefly
Write(ü) (ü) if if if
(i) (iii)
STA x>5,000/- 3,000 x<
%S
%f getchar constants.
Distinguish
pairs #include Why
characterdirective ? findWriteDefine What Write
characters.
Trigraph 3,000/- then Let
following A
printing
HC
reading
/-Sx<5,000/-- shopping
x
2/G and the be
and and a isdown - the
%e and median
programme keyword -print nodiscount
7
%C when total
the mall
specifications scanfbetween x-Rs.
discount
specifications of algorithm. bill
On do n in print scheme is
functions of
observations.
we in C? 150/ offering
a
the
backslash customer,
C/C++ x-Rs.
following
2+2+2=6 use :
Contd. for
the 50/ the
for 2 2 7 to 2 1 4
(g) () Explain different data types
available in C. 5
(i) Write a programme in C/C+t+ to
read the values of x and y and
print the results of the following
expressions in one line
X +y X+y
X-y 2 and (x +y) (x-y)
5
(h) () Write a note on reading strings
from terminal and writing
to screen. strings
1%+1=3
(i) Write a program in C/C++ to
multiply matrix A of order m x n
with matrix B of order n x l
store the result in a matrix and
Cof
order m x l.
7

HC 2/G 8
3(Sem-5/CBCS) STA 800
Total number of printed pages-7

3 (Sem-5/CBCS) STA HC 2

2021
(Held in 2022)
STATISTICs

(Honours)
Paper : STA-HC-5026
( Statistical Computing using C/C++
Programming )
Full Marks : 60

Time : Three hours

The figures in the margin indicate


full marks for the questions.
1. Answer the following as directed:
1x7=7

(a) The brain of any computer system is :


() ALU
(i) memory
(üi) CPU
(v) control unit
(Choose the correct option)
Contd.
(b) Evaluate 10% 2.
(g) Array can be considered as a set of
(c) A C-variable cannot start with elements stored in consecutive memory
locations having
() an alphabet )() different data type
(i) a digit (ii) same data type
(u) a special character other than (üi) same scope
underscore
(iv) None of the above
fiv) Both (i) and (iü) (Choose the correct option)
(Choose the correct option)
(d) The expression a= 22/7*5/3 would 2. Answer the following questions briefly:
evaluate the value of a as 2x4=8

(Fill in the blank) (a) Differentiate between hardware and


software.
(e) Which of the following escape
sequences moves the cursor position (b) Write the output of the following
to the new line? C-programme segment :
() \r
int a =45;
(i) \n
float b=3:5;
(ii) \t a= a+ b:
(iv) \v (Choose the correct option) =a-b;

State whether the following declaration a= (a+ b)/2;


is allowed in C: b= (a- b)/2;
Char str[3] = "GOOD"; printf (%d %f", a, b);
3 (Sem-5/CBCS) STA HC 2/G 2
3(Sem-5/ CBCS)STA HC2/G 3 Contd.
statement (i) What will be the output of the
(c) What does the
int A(50); following program segment ? 2

represent in C/C++ language ? main ()

(d) Write the following algebraic int i- 2, j= 3, k, l;


expressions in C/C++ :
float a, b;
3x2+ 2x+5
k=i/j"j;
2by 2 l= jli* i;
(i) a=i<j*j;
d+1 3y +x)
b-jli* i;
printf ("% d%d%f %f\n', k, <a, b);
3. Answer any three questions from the }
following: 5x3=15

(a) Draw a flowchart for calculating mean (e) Write a C/C++ program to determine
deviation from mean. the transpose of an n x n matrix A.

(b) Write a C|C++ program to find 4. Answer etther (a) or (b) :


arithmetic mean and harmonic mean
of n observations. (a) ) Write briefly on C tokens'. 2

(c) (ü) Write a note on 'else-if ladder.


Describe the 'switch' statement. 3
(d) ) Write a note on overflow and (iüi) Write a C/C++ programme to
underflow of data. 3 determine the value of n! 5

3(Sem-5/CBCS) STA HC 2/G 4 3 (Sem-5/CBCS) STA HC 2/G 5 Contd.


fiii) Write a programme in C/C++ to
variable x such
Evaluate float type obtain an approximate value of
(b) )
that et
X=a*b/2 +3/2*b+2+c the integral 1+x by using
assuming a =4, b= 1, c=32
2
Simpson's -rd rule. 7
3
(ü) Describe the for loop' briefly. 3
6. Answer either (a) or (b):
(üi) Write a C/C++ programme to
arrange n numbers in ascending (a) ) Elaborate on increment and
order. 5 decrement operators. 2
(i) Describe the procedure of
initialization of one-dimensional
5. Answer either (a) or (b) : array. 2

(a) ) What are different relational (üi) Write a C/C++ programme to find
the variance and coefficient of
operators available in C? 2
variation of n observations. 6
(ü) State the precedence rule of
2 (b) () Write an explanatory note on for'
arithmetic operators.
loop. 3
(üi) Write a C/C++ programme to find
the correlation coefficient of n pairs (i) Write a C/C++ programme to find
of observations. 6
an approximate solution of

the equation 1 --e* =0 using


(b) ) What is an algorithm ? 1
Newton-Raphson method. 7
(i) Briefly explain the do...while' loop.
2
3
3(Sem-5/CBCS) STA HC 2/G 6 (Sem-5/CBCS) STA HC 2/G 7 2500

You might also like