How To Exam?

a knowledge trading engine...


Centre for Development of Advanced Computing(C-DAC) 2005 M.C.A Computer Aplications -105 ProblemSolvingUsingC - - Question Paper

Saturday, 02 February 2013 11:55Web



(Please Write your Exam Roll No. immediately)    Roll No.

END-TERM EXAMINATION

FIRST SEMESTER [MCA] - DECEMBER 2005

Paper Code: MCA-105

Subject: Problem Solving Using C

Time: 3 Hours

(Batch - 2004 & 2005) Maximum Marks: 60

Note: Attempt five questions in all, including Q. 1 which is compulsory.

Q. 1. (a) Give syntax and task performed by the following functions in C language :-getch( ), getche( ), getchar( ), fgetc( )

(b)    An OS automatically opens three files whenever a C program is executed. Which are these three files and how are the referenced?

(c)    Give the meaning of the following format specifiers:-

%e %f %o %s %u %ld %14.5f

(d)    What is Abstract Data Types and Derived Data Type? Differentiate between structure and union data type.

(e)    What is placeholder? After the execution of x = y = z = 6 , What will be the value of x, y and z? Clearly write your assumptions, if any.

Q. 2. (a) Write a program to convert a string of digits into corresponding number e.g. string 12345 should be converted into a number 12345 and so that it can be used in any mathematical expression.

(b) Write a function substr( ) that takes two strings as arguments and tests whether first argument is a substring of second or not?

Q. 3. Define a structure containing the following information: name, employee code, age, qualification (last only) and date of joining. You can assume appropriate data type for each of the field. Then write a program to append record in a file called employee.txt.

Q. 4. (a) What is the advantage of linked list over array? Give an example in which static data allocation is better than dynamic allocation.

(b) Read the following function code and give output when input is (4, 5) Mystry (m, n)

{

if(m=0) return(n) else return (m-n)

}

Q. 5. (a) Give syntax of fread( ) and fwriter( ) functions and explain the meaning of each parameters.

(b) Write a program to multiply two matrices. Make a provision in your program to test whether two matrices are compatible for multiplication.

Q. 6. (a) Explain with example, concept of parameters by passing and by reference and by value. Your example should emphasize on the advantages and disadvantages of both.

(b) Write a function to concatenate string2 to string1 and result remains in string1.

Q. 7. (a) Consider the variable: int A[10], x, *y, **z . Now determine valid statement from the following:-

y=A; z = &y; y=&A; A=y; z=A

(b) Differentiate continue and break statement and also while and repeat until statement

Q. 8. (a) Write a program to compute EMI (Equated Monthly Installment) for a loan amount P for a period D years at rate of interest R% per annum on reducing balance.

(b) Give the output of the following program main( )

{

int y = 0; unsigned int x=0; while (x!=0) {x<<1; y--} printf(The value of y is %d, y);

}

END-TERM EXAMINATION

FIRST SEMESTER [MCA] - DECEMBER 2004

Paper Code: MCA-105

Subject: Problem Solving Using C

Time: 3 Hours

Maximum Marks: 60

Note: Attempt any six questions. All question carry equal marks.

Q. 1. (a) Justify that C is a structural language.

(b)    What is the purpose of including comments in a program? Can it extend beyond single line?

(c)    Differentiate between K= ++I and K=i++

(d)    if(q>=r)

printf(q is greater than or equal to b); else

printf(r is less than q);

Can it be written without if.........else statement.

(e)    What are the other forms of writing the statement total = total -1 ;

(f)    What will be the output of 123.456 in the format of %f?

(g)    Evaluate X given y=5 in the expression X = (YX=2) + (X=a=4);

(h)    A function may contain more than one RETURN statement (TRUE/FALSE).

(i)    Differentiate between ARRAY and STRUCTURE.

(j) What is a Linked List?

Q. 2. (a) Differentiate between the while STRUCTURE and do-while statement through a simple program.

(b) Explain SWITCH statement. Can it be replaced by IF statements.

Q. 3. (a) Write the output of the following program segment i=0

while(i<5)

if(i<3)

{

i +=2

printf(%d\n,i);

continue;

}

else

{

printf(%d\n, ==i); break;

}

printf (WELLDONE\n);

}

(b)    Describe the output of the following C program.

#include<stdio.h>

main()

{

int i=0, x=0; for(i=1;i<10;i*=2)

{

x++;

printf(%d,x);

}

printf(\n x= %d,x);

}

(c)    Describe the output of the following C program.

#include<stdio.h> main( )

{

int i,j,k,x=0;

for(i=0;i<5;++i)

for(j=0;j<i;++j)

{

switch(-i + j-1)

{

case -1: case 0: x + =1; break; case 1: case 2: case 3: x + =2; break; default: x + =3;

}

printf(%d,x);

}

printf(\n x=%d,x);

}

Q. 4. Write a program to find the sum of the series 1 - x2/2! + x4/4! - x6/6! +

Correct up to 3 pieces of decimal. The output should be For X =......Sum =........

Q. 5. (a) Describe the output #include<stdio.h> main( ) int n=10 int funct1(int n); printf (%d,funct 1(n));

}

int funct1(int n)

{

if(n>0) return (n + funct1(n-2));

}

(b) Write a function called DET that calculates the determinants of order 2. use it to calculate the determinate of order3.

Q. 6. Consider the following program. main( )

{

static struct item {

char *name; float price;

}

table[]=

{

(pickles,15.90),

(soda,2.50),

(Campa,5.50),

(bread,5.00),

(milk,4.60),

);

char item_name[21]; int quantity; i; do {

printf(Enter Item name); scanf(%s,item-name);

if(*item_name !=.)

{

for(i=0;i<(sizeof(table)/sizeof(struct item)&& strcmp (table[i]. name,item_name) ; i++);

if(i<sizeof(table)/sizeof(struct item))

{

printf(Enter quantity :); scanf(%d,&quantity);

printf(\n unit price = %.2f, total price = %2f. Inlnin, table[i].price, quantity* table[i].price);

}

else

printf(\n item \ %s \ does not exist. Inlnin, item_name);

}

}

while(*item_name!=.); printf(THANK YOU.\n);

}

Give the output when data is Item name    Quantity

Pickles    1

Bread    2

Juice    4

Modify the above program so that at the end before THANK YOU, it should give the total cost of all the items.

Q. 7. (a) Explain the concept of STRUCTURE within STRUCTURE by taking a simple example.

Q. 8. Draw flowchart / write algorithm of any two:-

(a)    Given set of K numbers. The output should be the difference of sum of even numbers and sum of odd numbers.

(b)    Finding the square root of a given numbers

(c)    Given any number. The output should be the sum of the digits of that number.

END-TERM EXAMINATION

FIRST SEMESTER [MCA] - DECEMBER 2002

Paper Code: MCA-101

Subject: Problem Solving & Computer Programming

Time: 3 Hours

Maximum Marks: 60

Note: Attempt any five questions, including Q. 1 which is compulsory. All question

carry equal marks.

Q. 1. Create a structure to specify data of customer in a bank. The data to be stored is:

Account number, Name, balance in account. Assume maximum of 200 customer in the bank.

(a)    Write a function to print the account number and name of each customer with balance below Rs. 100. If a customer request for with drawl or deposit, it is given in the form:

Account number, amount ( 1 for deposit, 0 for withdrawal)

(b)    Write a program to give a message, the balance is insufficient for the specified withdrawl.

Q. 2. (a) Write a program to sum the following series : 12 + 22 + 32 + 42 + 52 .....n2 ?

(b) Write a C program, which reads the three sides of a triangle and check whether it in an isosceles, equilateral or right angled triangle.

Q. 3. (a) Write a recursive function and hence the main function that computes the factorial of a number.

(b) Write a C program to reverse a string that is read from the keyboard?

Q. 4. (a) Write a C program that computes the GCD of two numbers, u and v?

(b) Distinguish between call-by-value and call-by-reference technique of parameter passing in C?

Q. 5. (a) Write a menu driven program in C with the following options:

(i) Prime number or not (ii) Odd or Even

(iii) Positive or Negative (iv) Exit?

(b) Write a function power (a, b) to calculate the value of a raised to b.

Q. 6. Using pointers, write C function to:

(a)    Sort an array of n integers in ascending order.

(b)    Search an element in the same array using binary search?

Q. 7. Write a C program which adds, subtracts, multiples and find the transpose of a matrix?

Q. 8. Write short notes on Any Three of the following :-

(a)    DO WHILE and WHILE loop

(b)    BREAK and CONTINUE Statement

(c)    Top Down Design

(d)    Command Line Arguments.

END-TERM EXAMINATION

FIRST SEMESTER [MCA] - DECEMBER 2001

Paper Code: MCA-101

Subject: Problem Solving & Computer Programming

Time: 3 Hours

Maximum Marks: 60

Note: Attempt any five questions, including Q. 1 which is compulsory.

Q. 1. Write a menu driven program in C with the following options:-    12

(a)    ADD (Appends a new record in the file)

(b)    MODIFY (Modifies the existing record)

(c)    DELETE (Deletes an existing record)

(d)    EXIT (Terminates the program execution)

Menu options are operated on the data file that contains the record of the following structure : EmpName -Character String of size 30, EmpNo- an integer number. Modification and deletion is based in the EmpNo. entered by the user.

Q. 2. (a) With the suitable examples, explain the storage classes i.e. automatic,

external, static and register available in C.    9

(b) What is the difference in break and continue statements? Explain with example.    3

Q. 3. Write an iterative program that will read in a positive integer value and determine the following:-

(i)    If the integer is a prime number

(ii)    If the integer is a Fibonacci number

The program should execute repeatedly, until a zero value is detected for the input quantity. Write functions for checking prime and Fibonacii numbers and use these in the main program.    12

Q. 4. (a) Match the following functions with the header files in which they are

defined:-    3

gets    string.h

toupper    math.h

pow    stdio.h

strlen    ctype.h

clrscr    conio.h getche

(b) How is an array different from basic data types? Write a program to search an element using binary search. Trace your program for the following inputs: 9

-3, 10, 0, 105, 90, -40, 72, 14

Q. 5. (a) What are command line arguments? Explain with suitable example. 3

(b) Write a program using pointers to compare two strings, which returns 1 if the first string is greater than he second string, 0 if both are equal and less than

0 if the first string is less than the second.    9

Q. 6. (a) Write an algorithm to find the square root of a number. Also find its time-complexity.    9

(b) What is conditional compilation? Explain with example.    3

Q. 7. (a) Explain the following operators in C :    6

(i)    Logical

(ii)    Relational

(iii)    Conditional

(iv)    Bit operators

(b) Write a C program segment to demonstrate pointers to function concept.

6

Q. 8. Write short notes on Any Three of the following :-    12

(a)    Pseudo Random Number generation

(b)    Call by value and call by reference

(c)    Character to numeric conversion

(d)    Control statement in C.







Attachment:

( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Centre for Development of Advanced Computing(C-DAC) 2005 M.C.A Computer Aplications -105 ProblemSolvingUsingC - - Question Paper