How To Exam?

a knowledge trading engine...


Vellore Institute of Technology 2007 M.C.A Computer Aplications Programming in 'C' - Question Paper

Friday, 01 February 2013 07:15Web

VIT
University
(Estd. u/s three of UGC Act 1956)
MCA - I Semester
Subject : Programming in C


Duration : 90 Minutes Max. Marks : 50

Part-A (4X5=20)
ans all the ques..

1. (i) What is the purpose of the function prototype? (1)
(ii) What would be the size of the pointer variables of kind float, integer and character? (1)
(iii) Can we have the identical name for the true and formal parameters? provide necessary explanation. (2)
(iv) What is meant by scope of the variable? (1)

2.Specify the output or the errors for the subsequent. presume all the necessary header files are included in the subsequent codes.
(i)void main()
{
int *i=10;
float *f=2.3;
char *c=’c’;
printf(“%d%f%c”,i,f,c);
}

(ii)void main()
{
int a=10,b=5;
char s=’A’;
printf(“%d”,a>b);
printf(“%f”,(float(int)s));
}

(iii)void main()
{
int t=1;
do {
printf(“Hello – It is C programming”);
while(t>2)
}

(iv)void main()
{
float a=10.23,b=4.5,c=45;
int x = 20;
char c = ‘A’;
printf(“%d”, (a>b)? ‘A’:’a’);
printf(“%d”, x>’A’);
}

(v)void display(int x)
{
printf(“%d”,x);
}
void main(void)
{
int i=10;
if((i>10) && (i<50))
display(i);
}

3.Write a function to print all the digits whose lowest significant digit is three ranging from the range one to 100. Pass the range to the function using pass by value.

4.Write a function which omits all the the digits that is divisible by 3of a provided number. Say for example, provided input is 2356891, digits that are divisible by three are 3,6,9 and the expected output is 2581.(Without using arrays).Pass the number to the function using pass by reference only.

Part - B (3X10=20)
ans all the ques..

5.(i) Extend the subsequent code with the help of the address of the pointer variable to display the values of i and j. (2)

#include
#include
Void main()
{
int *ptr, i=20,j=30;
ptr=&i;
printf(“%d”,*ptr);
ptr=&j;
printf(“%d”,*ptr);
}

(ii) Write a program to obtain all the divisors of the composite numbers ranging from the range one to 10. (Note : Numbers other than prime are called as composite numbers. (5)

(iii) Can a function return a address? provide an example for the identical. (3)

6.(i) discuss switch case with necessary examples. (6)
(ii)State the difference ranging from while loop and do-while loop. (2)
(iii)Explain any 3 shorthand arithmetic operators. (2)

7.(i)What would be the output for the subsequent code. (2)
#include
#include
int main()
{
int i =1;
switch(i)
{
case 1: printf(“Vit”);
case 2: printf(“University”);
default:printf(“Welcomes all”);
}
return;
}

(ii) Rewrite the subsequent code using the increment operator and do-while loop. presume all the necessary header files and void main are included in the subsequent code. The output for the rewritten code should be the identical as the code provided beneath. (3)
int i=0;
while(i<=50)
{
i=i+5;
printf(“%d”,i);
}

(iii) Specify the output or the fault for the subsequent. presume all the necessary header files and void main are included in the subsequent codes. (5)

(a)int i=0;
for((i==0);i<5;i++)
printf(“%d”,i);

(b)for(;;)
{
printf(“infinite loop”); break;
}

(c)int a=6,b=8;
for(;--a>0;)
printf(“%d%d”,a,--b);

(d) Rewrite the subsequent code with the ternary-if.
If(a>b)
printf(“A is greater”);
else
printf(“B is greater”);

(e)int a=5,b=5; a&=b;
b&=1; printf(“%d%d”,a,b);



( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Vellore Institute of Technology 2007 M.C.A Computer Aplications Programming in 'C' - Question Paper