2004 Centre for Development of Advanced Computing C DAC M C A MCA 105 Problem Solving Using C University Question paper for exam preparation. Question paper for 2004 Centre for Development of Advanced Computing C DAC M C A MCA 105 Problem Solving Using C University Question paper, 2004 Centre for Development of Advanced Computing C DAC M C A MCA 105 Problem Solving Using C University Question paper. SiteMap

## Exam Preparation

 • AIPMT Exam Preparation • Civil Services Exam Preparation • IIT JEE Exam Preparation • Class 12th Standard Exam Preparation • Class 11th Standard Exam Preparation • Class 10th Standard Exam Preparation • Class 9th Standard Exam Preparation • Class 8th Standard Exam Preparation

## Question Papers

 • Class 9th Standard Question Paper • Class 10th Standard Question Paper • Class 11th Standard Question Paper • Class 12th Standard Question Paper • BA Question Paper • BBM Question Paper • BCA Question Paper • BCom Question Paper • BE Question Paper • BSc Question Paper • BTech Question Paper • LLB Question Paper • LLM Question Paper • MA Question Paper • MBA Question Paper • MCA Question Paper • MCom Question Paper • MSc Question Paper • MTech Question Paper

# 2004 Centre for Development of Advanced Computing C DAC M C A MCA 105 Problem Solving Using C University Question paper

University Question Papers
2004 Centre for Development of Advanced Computing C DAC M C A MCA 105 Problem Solving Using C University Question paper
END-TERM EXAMINATION
FIRST SEMESTER [MCA] - DECEMBER 2004
Paper Code: MCA-105 Subject: Problem Solving Using C
Time: 3 Hours Maximum Marks: 60

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
{

Note: Attempt any six questions. All question carry equal marks.
printf(“%d\n”, ==i);
break;
}
printf(“WELLDONE\n”);
}
(b) Describe the output of the following C program.
#include
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
main( )
{
int i,j,k,x=0;
for(i=0;i<5;++i)
for(j=0;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
main( )
int n=10
int funct1(int n);
printf(“%d”,funct1(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),
(“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{
printf(“Enter quantity :”);
scanf(“%d”,&quantity);
printf(“\n unit price = %.2f, total price = %2f. |n|n|n”, table[i].price,
quantity* table[i].price);
}
else
printf(“\n item \” %s \” “does not exist. |n|n|n”, item_name);
}
}
while(*item_name!=’.’);
printf(“THANK YOU.\n”);
}
Give the output when data is
Item name Quantity
Pickles 1
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.