Está en la página 1de 4

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK
BATCH : 2007-2010

Semester/Branch : BE III /Electrical Engg.


Subject : Numerical Analysis and Computer Programming

Unit III

Q.1 Differentiate between C and C++ Programming Language.

Q.2 Define and describe the constants used in C with statements and

appropriate examples.

Q.3 Describe the different types of variables and their declaration with example

of each.

Q.4 Find errors (if any) and explain why for the following statements:

(i) Int X;

(ii) float letter, DIGIT.

(iii) double = P, q
(iv) exponent alpha, beta;
(v) m, n, z : INTEGER
(vi) long int m; count;
(vii) long float temp;

Q.5 Draw the basic structure of C programs. Explain its different sections in brief with
suitable examples.

Q.6 Write a program to find the area and perimeter of a rectangle using the formulae:

area = breadth*height

perimeter = 2* (breadth + height)

where breadth and height are in centimeters and can be in fraction.

Q.7 Write a program to find theorem and perimeter of a triangle from the lengths of its 3 sides

a, b and c (in inches and can be in fraction) :

perimeter = a + b + c
area =√ s(s-a) (s-b) (s-c)

where s =( a + b + c)/2

note that triangle can be formed if a < b+c and b < a+c and c< a+b.

Q. 8 Identify integer type variable among specifiers ------ char, double, long and the long

double. (2008)

Q.9 Describe and write two examples each of the following:

(i) IDE (Integrated Development Environment)

(ii) Compiler Directives

(iii) Header-files in C/C++

(iv) Library files in C/C++ (2008)

Q.10 Give the range of maximum/ minimum values with number of storage-bytes in char, int,

Long, float, double, long double, unsigned char, unsigned int, and unsigned double types

of variables in C/C++. (2008)

Q.11 Explain automatic type conversions among char, int, long, float and double data types in

C/C++ with examples. How to override it in any statement? (2008)

Unit IV

Q.1 Describe logical operators in C briefly.

Q.2 Describe how branching and looping is done in C with proper example.

Q.3 Find errors (if any) and explain why for the following statements:
i) scanf(“%c%f%d”, city ,&price,&year);
ii) printf(“a=%d b=%fn c=%c”\n,a,b,c);
iii) if(code>1);
a=b+c
else
a=0.
iv) name[] = getchar();
v) putchar(‘answer\n’);
vi) for( i=1; i<R; ++i )
}

printf(“*”);

}
vii) scanf(“%c %d %d ”, *code, &count , Root);

Q.6 Write a program to print multiplication table from 1 to 10 using do-while loop.

Q. 7 List the different data types in C language, their sizes, and their ranges on a lb bit
machine.
Q.8 Write a program to solve a quadratic equation ax2 + bx + c = 0 (a ≠ 0) . Tackle the 3 cases
d=0, d<0, d>0 (d = discriminant = b2 = b2 – 4 ac) series rately with suitable remarks. The
roots are given by:

- b ± √ b2 – 4ac
_____________
2a

The imaginary roots should be printed in the form of a + ib and a – ib.

Q.9 Write down syntax of scanf, printf, putchar and getchar functions. (2008)

Q.10. What is operator precedence? Draw precedence table for C/C++ language
operator. (2008)

Q.11 Explain the following C/C++ statements with flowchart and syntax of the each statement
explained: (2008)
(i) Nested do-while
(ii) Nested if
(iii) for loop
(iv) Nested switch
(v) Dangling else

Q.12 Define operators of C/C++ language. Describe the operation of any four arithmetic
assignment operators and any four logical operators with clearly giving at least one
suitable statement as example of the operators described. (2008)
Unit V

Q.1 Write a program for finding the values of mean, standard deviation and variance of n
fractional numbers using an array for storing numbers:
n
(i) mean = Σ xi
i=1

n
Σ xi
i=1
(ii) s.d. = √ n

_
(iii) where x = mean.
(iv) Variance = (s.d.)2

Q.2 Write a program for entering the elements of a matrix with a desired number of
rows and columns ( < =10).
Print the matrix and its
Q.1 Write declaration statement for one-dimensional, two- dimensional and multi-
dimensional arrays.
Q.2 Define and describe the character string in C with declaration statement. What are
the operations on character strings in C, explain with example.
Q.3 Describe:
i) Structure
ii) Arrays of structure
iii) Arrays with structures
iv) Pointers
v) structures with structures
Q.4 Write a program to sort ‘n’ numbers in descending order using array.

Q.5 What is a pointer variable? How it is defined in C/C++? (2008)

Q.6 Differentiate between call by value and call by reference methods of function
calls giving at least four points of differences with examples. (2008)

Q.7 Draw flowchart and write C/C++ code program to input two m * n dimensional
matrix and show all three in the screen of a computer, using ARRAYS. (2008)

Q.8 Write a program to find the real roots of quadratic equations using at least two
user defined functions in C/C++ and explain its algorithm. (2008)

También podría gustarte