(20 Marks)
5. A single line comment in C language source code can begin with _____
-; (B) - :
- /* - //
6. C programming : If you want to store dissimilar data together, then which type you will use?
array structure
stack None of the above
9. The function that calls itself for its processing is known as.
(C programming)
Inline Function Nested Function
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902
0 1
2 3
Q.-2) Write a c Program to swap the two values using function. (10 Marks)
Q-5) Write the output for the following code. (10 Marks)
1. void main()
{
printf("%d",-5%3);
}
a. 1
b. 2
c. -2
d. 2.5
2. void main()
{
int x=300*400/300;
printf("%d",x);
}
a. 300
b. None of these
c. 400
d. 100
3. #include< stdio.h>
void i(int *a,int *b)
{ a=b;
*a=2; }
int
x=0,y=1;
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902
int main()
{
i(&x,&y);
\
return 0;
}
- Published on 16 Jun 15
a. 22
b. 21
c. 02
d. 01
4. #include <stdio.h>
main()
{ char
*p = 0; *p
= 'a';
printf("value in pointer p is %c\n", *p);
}
a) It will print a
b) It will print 0
c) Compile time error
d) Run time error
5. #include <stdio.h>
main()
{ if (sizeof(int)
> -1)
printf("True");
else
printf("False");
}
a) True
b) False
6. #include <stdio.h>
main()
{
int n = 0, m = 0;
if (n > 0) if (m >
0)
printf("True"); else
printf("False");
}
a) True
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902
b) False
c) No Output will be printed
d) Run Time Error
7. #include <stdio.h>
void main()
{ int x = 0; int
*ptr = &x;
printf("%p\n", ptr);
ptr++; printf("%p\n
", ptr);
}
a)0xbfd605e80xbfd605ec
b)0xbfd605e80cbfd60520
c)0xbfd605e80xbfd605e9
d) Run time error
8. #include <stdio.h>
int main()
{ int i = 0;
while (i = 0)
printf("True\n");
printf("False\n");
}
a)True(infinitetime)
b)True(1time)False
c)False
d) Compiler dependent
9. #include <stdio.h>
struct temp
{ int
a; int b;
int c; }
p[] = {0};
main()
{
printf("%d", sizeof(p));
}
a) 4
b) 12
c) 16
char *name;
};
void main()
{
struct student s[2], r[2];
s[1] = s[0] = "alan";
printf("%s%s", s[0].name, s[1].name);
}
a)alanalan
b)Nothing
c)Compiletimeerror
d) Varies
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
SWD-ALC EXAM / C PROG/ FEB2019 PAPER CODE 201902
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________