Académique Documents
Professionnel Documents
Culture Documents
?????
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]
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]
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]
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]
x 0 1 2 3 4
y 5 12 37 86 165
?????
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]
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]
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]
?????