How To Exam?

a knowledge trading engine...


DOEACC Society 2006 DOEACC B Level B1.3 Programming and Problem Solving through 'C' Language ( ) - Question Paper

Friday, 14 June 2013 06:15Web
K. This guarantees that the loop is executed at
lowest once before continuing
L. preprocessor
M. can be used to create variables of new kinds
B1.3-R3 Page three of six July, 2006
4. every statement beneath has a blank space to fit 1 of the word(s) or phrase(s) in
the list beneath. Enter your option in the “tear-off” ans sheet attached to the
ques. paper, subsequent instructions therein. (1 x 10)
A. array B. string C. typedef
D. Cast E. structure F. EOF
G. void H. C functions I. gets
J. C preprocessor K. getstr L. describe
M. & N. char O. malloc
4.1 The _________ operator is used to convert 1 data kind to a different.
4.2 If the pointer variable ptr holds the address of a char, the data kind of *ptr will be
__________.
4.3 File is described with a(n) __________ statement.
4.4 Functions of kind __________ do not return a value to the calling segment.
4.5 A(n) __________ is a collection of variables under a single name.
4.6 ____________ reads a whole line of input into a string until a new line or EOF is
encountered.
4.7 Expressions can be made equivalent to a single identifier using the preprocessor
_________ command.
4.8 The ____________ is a program that is executed before the source code is compiled.
4.9 The ____________ operator is unary operator to obtain the value of a variable.
4.10Dynamic allocation of memory for structure can be done with the help of the _________
function.
B1.3-R3 Page four of six July, 2006
PART TWO
(Answer any 4 questions)
5.
a) Write the C Statements (all necessary statements) that open the file inf.dat for reading,
and open the file outf.dat for writing.
b) Write the C program to write
“Introduction to C-Programming”
to the file outf.dat.
c) Write a C program that reads integers from the file scores.dat. After all the integers have
been read, the program writes the sum of all the nonnegative integers to the video
display. presume that the file scores.dat contains at lowest 1 integer.
(5+4+6)
6.
a) Write a ‘C’ program to compute and display the monthly income of a salesperson
corresponding to the value of monthly sales input in the scanf() function, let us consider
the subsequent commission schedule: (Note: use if-else statement)
Monthly Sales Income
Greater than or equal to Rs.50,000 375 plus 16% of sales
Less than Rs. 50,000 but
Greater than or equal to Rs. 40,000 350 plus 14% of sales
Less than Rs. 40,000 but
Greater than or equal to Rs. 30,000 325 plus 12% of sales
Less than Rs. 30,000 but
Greater than or equal to Rs. 20,000 300 plus 9% of sales
Less than Rs. 20,000 but
Greater than or equal to Rs. 10,000 250 plus 5% of sales
Less than Rs. 10,000 200 plus 3% of sales
b) What is printed after execution of every of the subsequent C-programs?
1. void main()
{f
loat reals[5];
*(reals+1) = 245.8;
*reals = *(reals + 1);
printf(“ %f”, reals[0] );
}
2. void main( )
{ int nums[3];
int *ptr = nums;
nums[0] = 100;
nums[1] = 1000;
nums[2] = 10000;
printf( “%d\n”, ++*ptr );
printf( “%d”, *ptr );
B1.3-R3 Page five of six July, 2006
}
B1.3-R3 Page six of six July, 2006
3. void main()
{ int digit =
0;
while (digit <= 9)
printf( “%d\n”, digit++);
}
4. void main()
{ int a=7, b=6;
fun1(a,b);
printf(“\n a is %d b is %d”, a, b);
}
int fun1(int c,int d)
{ int e;
e = c * d;
d = seven * c;
printf(:\n c is %d d is %d e is %d”, c, d, e);
return;
}
(7+[2x4])
7.
a) Write a C function word_count() to count the number of words in a provided string and then
call in Main().
b) Write a C function print_upper() to prints its character argument in uppercase.
c) Write a macro that clears an array to zero.
(7+4+4)
8.
a) What is a Structure? describe a structure that contains the subsequent members:
i) An integer volume called acct_no
ii) A character called acct_type
iii) A 40-element character array called name
iv) A floating-point volume called balance
v) A structure variable called lastpayment, of kind date: described as an integer called
month; an integer called day; an integer called year
vi) Include the user_defined data kind account within the definition.
vii) Include structure variable customer, which is 100-element array of structures
called account.
b) What is Pointer in C? How Pointers and Arrays are related?
(8+7)
9. Write short notes on any 3 of the following:
a) Switch statement (give proper syntax and examples)
b) What do you mean by Loop? How while-loop and do-loop differs?
c) What is C Preprocessor? discuss any 2 C preprocessor commands with example.
d) Break and continue on Statements
(3x5)
B1.3-R3 Page seven of six July, 2006




( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER DOEACC Society 2006 DOEACC B Level B1.3 Programming and Problem Solving through 'C' Language ( ) - Question Paper