Vous êtes sur la page 1sur 4

Code No: R5100306 1

I B.Tech (R05) Supplementary Examinations, June 2009


COMPUTER PROGRAMMING AND NUMERICAL METHODS
(Mechanical Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. (a) Explain the following & illustrate it with an example each.


i. Increment & Decrement operator.
ii. Conditional operator.
iii. Bitwise operator.
iv. Assignment operator.
(b) State the rules that applied while evaluating expression in automatic type conversion.
[12+4]
2. (a) In what way array is different from an ordinary variable?
(b) What conditions must be satisfied by the entire elements of any given array?
(c) What are subscripts? How are they written? What restrictions apply to the values that
can be assigned to subscripts?
(d) What advantage is there in defining an array size in terms of a symbolic constant rather
than a fixed integer quantity?
(e) Write a program to find the largest element in an array. [3+2+3+3+5]
3. (a) What is a pointer? List out the reasons for using pointers.
(b) Write a C Program to illustrate the use of indirection operator “ * ” to access the value
pointed by a pointer. [8+8]
4. Write a C program to add the two given complex numbers. Define functions add and print
with pointers as arguments. The complex number is a structure object with real and image
fields. [16]
5. Use the operations push, pop, stacktop, and empty to construct operations on stack, which do
each of the following:
Given an integer n, set i to the n the element from the top of stack, leaving the stack unchanged
Set I to the bottom element of stack, leaving the stack empty. [16]
6. (a) Find a root of xsinx+ cosx=0 which is near to π using Newton’s formula
(b) Find a root of xex -cosx=0 using Regula falsi method. [8+8]
³ 2
´2
7. (a) Prove that 1 + µ2 δ 2 = 1 + δ2
(b) From the following table of half yearly premium for policies at quinquennial ages estimate
the premium for policies at the age of 63. [6+10]
Age: x: 45 50 55 60 65
Premium: y: 114.84 96.16 83.32 74.48 68.48
dy
8. (a) Find dx
at x=1

x .7 .8 .9 1.0 1.1 1.2 1.3


f(x).644218 .717356 .783327 .841471 .891207 .932039 .963558
R4
(b) Evaluate ex dx using simpson’s 13 rd rule. Taking h=.5 [8+8]
6

?????
Code No: R5100306 2
I B.Tech (R05) Supplementary Examinations, June 2009
COMPUTER PROGRAMMING AND NUMERICAL METHODS
(Mechanical Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. Write about space requirements for variables of different data types. [16]

2. (a) Distinguish between user defined and built-in functions.


(b) What is meant by function prototype. Give an example function prototype.
[8+8]

3. (a) What is a pointer? List out the reasons for using pointers.
(b) Write a C Program to illustrate the use of indirection operator “ * ” to access the value
pointed by a pointer. [8+8]

4. (a) When are array of structures are used? Declare a variable as array of structure and
initialize it?
(b) Write a C program to calculate student-wise total for three students using array of struc-
ture. [8+8]

5. (a) Explain the concept of a stack and write different functions of it.
(b) Write a C program to evaluate postfix expression. [8+8]

6. (a) Find a real root of xex =3 using Regula falsi method


(b) Find a root of the equation 2xtanx=1 by Newton Raphson method [8+8]

7. (a) Prove that (1 − ∆) (1 − ∇) = 1


(b) Express the polynomial x3 - 2x2 + x - 1 interms of factorial notation
(c) Find f(2) given that f(0)=5, f(1)=6,f(3)=50 f(4)=105 using Langrange’s interpolation for-
mula. [5+5+6]
R
5.2
8. (a) Evaluate log xdx taking h=.2 using Trapezoidal rule
4

Rb
(b) Using Simpson’s (1/3) rule evaluate ydx
0
x: 0 1 2 3 4 5 6
y: 0 0.4 4.9 25.4 81.8 195.2 373.2 [8+8]

?????
Code No: R5100306 3
I B.Tech (R05) Supplementary Examinations, June 2009
COMPUTER PROGRAMMING AND NUMERICAL METHODS
(Mechanical Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. Write about space requirements for variables of different data types. [16]

2. (a) Write a C program to do Matrix Multiplications.


(b) Write in detail about one dimensional and multidimensional arrays. Also write about how
initial values can be specified for each type of array? [8+8]

3. The roots of a quadratic equation of the form ax2 +bx+c = 0 are given by the following equa-
tions: p
X1 = −b + (b2 − 4ac)/2a
p
X2 = −b − (b2 − 4ac)/2a
Write a function to calculate the roots. The function must use two pointer parameters, one to
receive the coefficients a,b and c and the other to send the roots to the calling function. [16]

4. Write a C program to add the two given complex numbers. Define functions add and print
with pointers as arguments. The complex number is a structure object with real and image
fields. [16]

5. (a) Differentiate between prefix expression and postfix expression.


(b) Write a C program to perform push and pop operations on stack. [8+8]

6. (a) Find a real root of ex sinx=1 using Regula falsi method


(b) Find a real root of the equation x3 +x2 -1=0 by successive approximation method. [8+8]

7. (a) Find the polynomial from the following data

x 0 1 2 3 4
y 5 12 37 86 165

Using Newton’s forward formula


(b) The following table gives the normal weights of babies during the first 12 months of life
Age ( in months ) 0 2 5 8 10 12
1 1 [8+8]
weights ( in lbs ) 7 2 10 4 15 16 18 21
dy
8. (a) Find y(.1) and y(.2) using Taylor’s series method given that dx
= x2 − y,
y(0) = 1
(b) Tabulate the values of y(.2), y(.4),y(.6),y(.8) and y(1) using Euler’s method given that
dy
dx
= x2 − y, y(0) = 1 [8+8]

?????
Code No: R5100306 4
I B.Tech (R05) Supplementary Examinations, June 2009
COMPUTER PROGRAMMING AND NUMERICAL METHODS
(Mechanical Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. Write about space requirements for variables of different data types. [16]

2. (a) What is macro. What are the differences between macros and functions.
(b) Give a brief note about.
i. Error directive
ii. Pragma directive. [8+8]

3. (a) How to use pointers as arguments in a function? Explain through an example.


(b) Write a ‘C’ function using pointers to exchange the values stored in two locations in the
memory. [8+8]

4. (a) Explain with an example how a structure can be organized in the ‘C’ language?
(b) Write a C program to print maximum marks in each subject along with the name of the
student by using structures. Take 3 subjects and 3 students records. [8+8]

5. What is a Queue? Explain two applications of it. What are the advantages of a Circular Queue
over a linear queue? [4+6+6]

6. (a) Find a real root of xex -5x-6=0 using bisection method


(b) Find a root of the equation x3x =2 by Regula falsi method. [8+8]

7. (a) Find the polynomial from the following table

x 0 1 2 3 4
y 5 12 37 86 165
(b) For X=20,25,32,49 and Cos(x) = 0.939, 0.906, 0.848, 0.656 find Cos(43) using Lagrange’s
formula. [8+8]
dy
8. Find y(.1) and y(.2) using picard’s mehod given that dx
= 1 − 2xy, y(0)=0 [16]

?????

Vous aimerez peut-être aussi