Docsity

Exams of COMPUTER PROGRAMMING and NUMERICAL, Study notes of Computer Numerical Control

Toggle sidebar
bg1
Code No: R05010303 Set No. 1
I B.Tech Semester Supplimentary Examinations, June 2009
COMPUTER PROGRAMMING AND NUMERICAL METHODS
( Common to Mechanical Engineering, Chemical Engineering, Mechatronics,
Metallurgy & Material Technology, Production Engineering and Automobile
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
1. (a) What is the difference between short integer and long integer in terms of
memory, range, control string and variable declaration.
(b) Distinguish between float and double in terms of storage and range. [8+8]
2. (a) Write a program to demonstrate passing an array argument to a function.
Consider the problem of finding largest of N numbers defined in an array.
(b) Write a recursive function power (base, exponent) that when invoked returns
base exponent. [8+8]
3. (a) Write a ‘C’ program to find factorial of a given number using pointers.
(b) Write a ‘C’ program to arrange the given names in alphabetical order using
pointers. [8+8]
4. Define a structure that can describe a hotel. It should have members that include
the name, address, grade, average room charge, and number of rooms. Write a C
program to perform following operations:
(a) To print out hotels of a given grade in order of charges.
(b) To print out hotels with room charges less than a given value. [8+8]
5. What is a Queue? Explain the various operations performed on Queues with suit-
able algorithms. [4+12]
6. (a) Find a real root of x4-x-10=0 using bisection method
(b) Find a real root of the equation xex-cosx-0 by iteration method [8+8]
7. (a) Find y(1.85) using Newton’s interpolation formula
x 1.7 1.8 1.9 2.0 2.1 2.2
y 5.474 6.05 6.686 7.389 8.166 9.025
(b) Find y(30) using Gauss forward interpolation formula given that y(21)=18.4708,
y(25)=17.8144, y(29)=17.107, y(33)=16.3432, y(37)=15.5154. [8+8]
8. (a) Evaluate
1
R
0
dx
1+xusing Booles rule taking h=.25
1 of 2
pf3
pf4
pf5

Partial preview of the text

Download Exams of COMPUTER PROGRAMMING and NUMERICAL and more Study notes Computer Numerical Control in PDF only on Docsity!

I B.Tech Semester Supplimentary Examinations, June 2009 COMPUTER PROGRAMMING AND NUMERICAL METHODS ( Common to Mechanical Engineering, Chemical Engineering, Mechatronics, Metallurgy & Material Technology, Production Engineering and Automobile Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆ ⋆ ⋆ ⋆ ⋆

  1. (a) What is the difference between short integer and long integer in terms of memory, range, control string and variable declaration. (b) Distinguish between float and double in terms of storage and range. [8+8]
  2. (a) Write a program to demonstrate passing an array argument to a function. Consider the problem of finding largest of N numbers defined in an array. (b) Write a recursive function power (base, exponent) that when invoked returns base exponent. [8+8]
  3. (a) Write a ‘C’ program to find factorial of a given number using pointers. (b) Write a ‘C’ program to arrange the given names in alphabetical order using pointers. [8+8]
  4. Define a structure that can describe a hotel. It should have members that include the name, address, grade, average room charge, and number of rooms. Write a C program to perform following operations:

(a) To print out hotels of a given grade in order of charges. (b) To print out hotels with room charges less than a given value. [8+8]

  1. What is a Queue? Explain the various operations performed on Queues with suit- able algorithms. [4+12]
  2. (a) Find a real root of x^4 -x-10=0 using bisection method (b) Find a real root of the equation xex-cosx-0 by iteration method [8+8]
  3. (a) Find y(1.85) using Newton’s interpolation formula

x 1.7 1.8 1.9 2.0 2.1 2. y 5.474 6.05 6.686 7.389 8.166 9. (b) Find y(30) using Gauss forward interpolation formula given that y(21)=18.4708, y(25)=17.8144, y(29)=17.107, y(33)=16.3432, y(37)=15.5154. [8+8]

  1. (a) Evaluate

∫^1

0

dx 1+x using Booles rule taking h=.

(b) The table below shows the temperature f(t) as a function of time

t 1 2 3 4 5 6 7 f(t) 81 75 80 83 78 70 60

Use Simpson’s 1/3 method to estimate

∫^7

1

f (t)dt [8+8]

i. Simpson’s 13 rd rule

ii. Trapezoidal rule. [8+8]

I B.Tech Semester Supplimentary Examinations, June 2009 COMPUTER PROGRAMMING AND NUMERICAL METHODS ( Common to Mechanical Engineering, Chemical Engineering, Mechatronics, Metallurgy & Material Technology, Production Engineering and Automobile Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆ ⋆ ⋆ ⋆ ⋆

  1. (a) What is meant by looping? Describe any two different forms of looping with examples. (b) Write a program to print the following outputs using for loops: [8+8] i) 1 ii) 1 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4
  2. (a) Write a recursive C program to calculate the sum of 1 to n integers. (b) Write a recursive and a iterative C-programs to find the factorial of N. [6+10]
  3. (a) Define a pointer. What are the advantages of using a pointer? (b) Write a program to change all uppercase letters in a file to lower case letters and vice versa. [6+10]
  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 structure. [8+8]
  5. (a) Define stack write a C program that reverses a string using stack. (b) Write a recursive function that returns the factorial of a given number. [8+8]
  6. (a) Find a real root of the equation x^3 - x - 4 = 0 by bisection method (b) Use iteration method to find a root of the equation x = 12 + sin x [8+8]
  7. (a) Find f(8) using Newton’s forward difference formula from the following table

x 4 5 7 10 11 13 f(x) 48 100 294 900 1210 2028 (b) Find the unique polynomial P(x) of degree2 or less such that P(1)=1, P(3)=27, P(4)=64 using Lagrange interpoaltion formula and Newton divided difference formula. [8+8]

  1. Find y(.1) and y(.2) using Runga kuta 4th order formul given that y′^ = x^2 − y and y(0)=1 [16]

I B.Tech Semester Supplimentary Examinations, June 2009 COMPUTER PROGRAMMING AND NUMERICAL METHODS ( Common to Mechanical Engineering, Chemical Engineering, Mechatronics, Metallurgy & Material Technology, Production Engineering and Automobile Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆ ⋆ ⋆ ⋆ ⋆

  1. (a) Summarize the syntactic rules associated with the do-while statement. Com- pare it with the while statement. (b) Write a C program that will read a positive integer and determine and print its binary equivalent. (c) Write a program to generate 10 Fibonacci numbers using do....While loop. [4+8+4]
  2. (a) Write a recursive C program to calculate the sum of 1 to n integers. (b) Write a recursive and a iterative C-programs to find the factorial of N. [6+10]
  3. (a) Explain the process of declaring and initializing pointers. Give an example. (b) Write a C program that uses a pointer as a function argument. [8+8]
  4. Explain the following with an example each:

(a) Array of structures. (b) Structures within structures. [8+8]

  1. (a) Explain the concept of a stack and write different functions of it. (b) Write a C program to evaluate postfix expression. [8+8]
  2. (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]
  3. (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]

  1. Tabulate the values of y(.1) to y(1) taking h=.1 using Euler’s method given that dy dx = 1^ −^ y, y(0)=0^ [16]