0% found this document useful (0 votes)
89 views2 pages

Institute of Aeronautical Engineering: (Autonomous) Computer Programming (Common For CSE/IT/ECE/EEE)

This document appears to be an exam paper for a Computer Programming course. It contains 10 questions across 5 units related to programming concepts like data types, operators, functions, structures, files, and more. The questions test students' ability to write C programs to perform tasks like type conversion, calculating area of a triangle, evaluating expressions, reversing strings, finding prime factors, and manipulating dates, times, and files. Students are instructed to answer one question from each unit, with each part of the question worth 7 marks, for a total exam mark of 70.

Uploaded by

Derek scott
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views2 pages

Institute of Aeronautical Engineering: (Autonomous) Computer Programming (Common For CSE/IT/ECE/EEE)

This document appears to be an exam paper for a Computer Programming course. It contains 10 questions across 5 units related to programming concepts like data types, operators, functions, structures, files, and more. The questions test students' ability to write C programs to perform tasks like type conversion, calculating area of a triangle, evaluating expressions, reversing strings, finding prime factors, and manipulating dates, times, and files. Students are instructed to answer one question from each unit, with each part of the question worth 7 marks, for a total exam mark of 70.

Uploaded by

Derek scott
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Hall Ticket No Question Paper Code: ACS001

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
B.Tech I Semester End Examinations (Regular) - December, 2016
Regulation: IARE-R16
COMPUTER PROGRAMMING
(Common for CSE/IT/ECE/EEE)
Time: 3 Hours Max Marks: 70
Answer ONE Question from each Unit
All Questions Carry Equal Marks
All parts of the question must be answered in one place only

UNIT – I

1. (a) What do you mean by type conversion? When it is required? Explain with suitable example.
[7M]
(b) The Scalene triangle is one category of triangles which have 3 unequal sides and 3 unequal angles.
Assume that user inputs 2 sides and the in between angle. Write a C program to compute area
for this scenario using the formula. [7M]
k = ab (sin (c) /2)

2. (a) Explain how evaluation of expression takes place in computer. Evaluate the following expression:
i = 2 ∗ 3/4 + 4/4 + 8 − 2 + 5/8 [7M]
(b) If a five-digit number is input through the keyboard, write a C program to print a new number
by adding one to each of its digits. For example if the number that is input is 12391 then the
output should be displayed as 23402. [7M]

UNIT – II

3. (a) While purchasing certain items, a discount of 10% is offered if the quantity purchased is more
than 1000. If quantity and price per item are input through the keyboard, write a C program to
calculate the total expenses. [7M]
(b) Write a C program to reverse a input string given by user (without using string library functions).
[7M]

4. (a) In number theory, the prime factors of a positive integer are the prime numbers that divide that
integer exactly. For instance 2 and 5 are the prime factors of 10. Write a C program to enter
any number and find all Prime factors of the number. [7M]
(b) Write a C program that computes frequency of characters in a string i.e. which character is
present how many times in a string. For example in the string ”code” each of the character
’c’, ’o’, ’d’, and ’e’ has occurred one time. Only lower case alphabets need to be considered for
counting and other characters (uppercase and special characters) must be ignored. [7M]

Page 1 of 2
UNIT – III

5. (a) Define a macro MIN and MAX that gives the minimum and maximum of two values. Then write
a C program to test the macro definition. [7M]
(b) Write a function called arraySum that takes two arguments: an integer array and the number of
elements in the array. Have the function return as its result the sum of the elements in the array.
[7M]

6. (a) Write a C program to pass an array containing age of person and number of persons to a function.
This function should find average age and display the average age in main function. [7M]
(b) Write a c program to swap three integers in cyclic order using call by reference. [7M]

UNIT – IV

7. (a) How Structure and unions are assigned memory? Explain with diagram. [7M]
(b) Write a function elapsed_time that takes as its arguments two time structures and returns a
time structure that represents the elapsed time (in hours, minutes, and seconds) between the two
times. [7M]

8. (a) What is structure variable? Can a structure variable be defined as member of another structure?
Explain with example. [7M]
(b) Write a C program which asks the user to enter today’s date and calculates tomorrow’s date and
display the results. [7M]

UNIT – V

9. (a) Is it possible to pass arguments to C programs when they are being executed? Justify. [7M]
(b) Write a C program to write name and height of five students using an array of structures to a file
via fwrite(). Further, the program must read the array from the file and display on the screen.
[7M]

10. (a) What is EOF? How can we read a file, if it has multiple EOF characters? Compare with examples
the text file and binary file. [7M]
(b) Write a program that merges lines alternately from two files and writes the results to new file.
If one file has less number of lines than the other, the remaining lines from the large file should
be simply copied into the target file. [7M]

Page 2 of 2

You might also like