How To Exam?

# Centre for Development of Advanced Computing(C-DAC) 2004 M.C.A -105 Problem Solving Using C - Question Paper

Saturday, 02 February 2013 02:20Web

END-TERM exam
FIRST SEMESTER [MCA] - DECEMBER 2004
Paper Code: MCA-105 Subject: issue Solving Using C
Time: three 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 ranging from 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) elaborate 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 provided y=5 in the expression X = (YX=2) + (X=a=4);
(h) A function may contain more than 1 RETURN statement
(TRUE/FALSE).
(i) Differentiate ranging from ARRAY and STRUCTURE.
(j) What is a Linked List?

Q. 2. (a) Differentiate ranging from the while STRUCTURE and do-while statement through a simple program.
(b) discuss SWITCH statement. Can it be changed by IF statements.

Q. 3. (a) Write the output of the subsequent program segment
i=0
while(i<5)
if(i<3)
{
i +=2
printf(“%d\n”,i);
continue;
}
else
{

Note: Attempt any 6 ques.. All ques. carry equal marks.
printf(“%d\n”, ==i);
break;
}
printf(“WELLDONE\n”);
}
(b) define the output of the subsequent 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) define the output of the subsequent 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 obtain the sum of the series
1 – x2/2! + x4/4! - x6/6! +
accurate up to three pieces of decimal. The output should be
For X = ……Sum = ……..

Q. 5. (a) define 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 compute the determinate of order3.

Q. 6. Consider the subsequent 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;
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 volume :”);
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”);
}
provide the output when data is
Item name volume
Pickles 1
Juice 4
replace the above program so that at the end before THANK YOU, it
should provide the total cost of all the items.

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

Q. 8. Draw flowchart / write algorithm of any two:-
(a) provided 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 provided numbers
(c) provided any number. The output should be the sum of the digits of that number. 