Download DBATU B-Tech 1st Year 2017 Dec Basic Computer Programming 2 Question Paper

Download DBATU (Dr. Babasaheb Ambedkar Technological University) B.Tech First Year 2017 Dec Basic Computer Programming 2 Question Paper

A
1\L31\Z?320\11\?2.4?l 000 +
DR. BABASAHEB AMIEDKAR TECHNOLGGECAL UNEVERSITY
LONERE - RAIGAD? 402 103
Semester Examination ? December - 2017
Branch: B. Tech. Semester: I
Subject with Subject Code: Basic Computer Programming Marks: 60
[ICT106]
Date: 22/12/2017 Time: 3 Hrs.
Instructions: 1] Attempt any 5 Questions.
2] Figures / structures to the right indicate full marks.
3] Each Question Carry 12 Marks.
4] Assume suitable data, if necessary.
5] N eat diagrams must be drawn wherever necessary.
Q. No. 1
A) i. What do curly braces denote in C? Why does it make sense to use curly braces to [2]
surround the body of function?
ii. Consider the statement: double ans = 10.0 + 2.0 / 3.0 - 2.0 * 2.0; [1]
Rewrite this statement, inserting parenthesis to ensure that ans = 11.0 upon evaluation
of this Statement. [1]
iii. Explain why given statement is not correct, and fix it.
#include"stdio. h".
B) Explain the various phases of process of programming in details. [4]
C) Convert the following Flowchart E)
into C Program. A single V o
?owchart divided into two part
Declare the
where S is branching to show variables
continuous ?ow of a program. \ N0
9? ?
Take the Input
in varlables
'rint the value ,.
of m

Q. No. 2
A)
B)
B)
C)
Q. No. 3
A)
A)
B)
Write logical expressions that tests whether a given character variable in C is
1. lower case letter
11' upper case letter
iii. digit
iv. whitespce (includes tab, space, newline)
Evaluate the expression:
expression evaluation.
[4]
1 && o % 10 >= 0 && 30 % 1o <= 3. Show the steps of your [4]
Write the values of the following expressions.
i.'F' ? 'c'
ii.2.o + (float)(5/3)
OR
With proper example explain following Bitwise Operators:
1. Left Shift Operator
ii. Bitwise AND
iii. Right Shift Operator
iv. Bitwise Complement Operator
Define the variable in C. What are the rules programmer has to follow for declaration of
any variable. Give an example of variable declaration and variable initialization.
Telephone company charges its domestic consumers as follows:
No. of phone Calls
. Rate of Charge
0 ? 200 Rs. 0.50 pet unit
201 ? 400 Rs. 100 plus Rs.0.65 per unit excess of 200
401 and above Rs. 230 plus Rs.0.80 per unit excess of 400
Write a program that reads the customer telephone number and number of phone calls
and prints the amount to be paid by the customer.
OR
.. [4]
[4] V
[4]
The digital root of a number is single digit number obtained by an iterative process of [4]
summing digits. Digital sum of 65536 is 7, because 6+5+5+3+6=25 and 2+5 = 7. Write a
program that takes an integer as input and prints its digital root.
Differentiate between:
1. While Loop and do ..... while Loop. , .
ii. break and continue statement. ' '
1n/1r?nnm ??"(0DOADhlnDDn10hDJ?1/100
[4]

C)
Q. No. 4
A)
B)
/ \
C)
Q. No. 5
A)
i. Write the syntax of switch statement.
ii. What Will be the output of the following program?
#include
int main(){
int i, j, k;
for(i=1;i<10;i++){
printf(?\n %d: ", i);
for(j=1;j<10;j++){
if(i%3 :2 0) break;
if(i > j) continue;
k=i*10+j;
printf(" %d", k);
What will be printed by the following program?
int f(int a){
printf("%d,", a);
a++;
return a;
int main(){
int a = 5, b;
b = f(a);
printf("%d,%d\n", a, b);
return 0;
Write a program in C Which take an integer number x from user. Write a function which
find given number is Armstrong or not i.e. void armstrong(int n) which not return any
value. Take input value x in main() function and use function call armstrong(x) . In
function, void armstrong(int n) display message as "Enter number is _ is an
armstrong number" OR "Enter number is __ is not an armstrong number"
i. What do you mean by recursion?
ii. With proper example give the syntax of function call, and function definition.
when programmer has to use function prototype in program. Give syntax of
function prototype.
iii. Explain any one Static Storage Class with a proper C code.
A teacher has to enter mark of 5 subjects of a student and has to find the average of that
marks. Which data type would you suggest to programmer and write C program to take
the input from programmer and find the average of entered marks. Also Display data
entered by programmer and average find through program on Screen.
[1]
[3]
[3]
[3]
[1]
[3]
[2]
[4]

B)
C)
Q. No. 6
A)
B)
C)
#include
void sortins(int f[],int p){
int temp, i, j;
for(j = 1; j < p; j++){
temp = f[j];
i=j-1;
while(i >= 9 && f[i] > temp){
f[i+1] = f[i];
1";
}
f[i+1] = temp;
}
void main(){
int A[8] = {27,25,73,65,30,68,39,77};
sortins(A,8);
}
Write the values of f [i] in each iteration when it is inside while loop.
Define Array.
Initialize two dimension array and show matrix representation of initialized two
dimension array. '
Write C statements for one dimension array to do the following:
1. Set the value of the 5?11 component of the alpha array to 35. V -
ii. Set the value of the 9?h component of the alpha array to the sum of the 6'h and 13?h
components of the alpha array.
Define a structure in C named 'Student' which contains four fields as {name, age, gender,
department}. Declare a variable as your name of 'struct Student'. Assign the values for
your structure as xyz, 23, Male, Computer respectively.
Write a program in C to create a structure having named as Employee consists of
empCode, name, department, address and salary as its members. Use array of structure to
read the details for five employees from user and then display the data entered by the
user on Screen.
Date is an entity which consists of hours, minutes and seconds. Account is a second
entity which consists of acct_no, acct_type('S' for saving and 'C' for current),
name_of_account_holder, balance in respective acct_no, date_of_1astpayment which is
already defined using Date entity. Write a syntax in C from given data and also initialize
the value to every elements using dot operator.
[1]
[2]
[2]
[3]
[6]
[3]

This post was last modified on 17 May 2020