Professional Documents
Culture Documents
Pre-Assessment Module: Dashboard PA Set-A
Pre-Assessment Module: Dashboard PA Set-A
1. Dashboard
2. My courses
3. PA
4. Topic 1
5. SET-A
Previous Activity
Next Activity
Started on Wednesday, 1 May 2019, 1:52 PM
State Finished
Completed on Wednesday, 1 May 2019, 1:59 PM
Time taken 6 mins 57 secs
Question 1
Complete
Marked out of 2
Flag question
Question text
#include<stdio.h>
int main()
int i;
i = 10;
printf("i : %d\n",i);
printf("i : %d\n",i);
return 0;
Select one:
a. compile time error
b. run time error
c. i=10, sizeof(i++) is:4,i=11
d. i=10, sizeof(i++) is:4,i=10
Question 2
Complete
Marked out of 2
Flag question
Question text
# include <stdio.h>
int n = sizeof(arr);
int i;
int main()
print(arr);
return 0;
Select one:
a. Compile Error
b. Runtime error
c. 209874
d. 1 2 3 4 5 6 7 8
Question 3
Complete
Marked out of 2
Flag question
Question text
#include <stdio.h>
struct point
int x;
int y;
};
struct notpoint
int x;
int y;
};
int main()
p1 = foo();
printf("%d\n", p1.x);
return temp;
Select one:
a. Garbage Value
b. 1
c. 2
d. Compilation Error
Question 4
Complete
Marked out of 2
Flag question
Question text
Question 5
Complete
Marked out of 2
Flag question
Question text
main( )
while(i++ <a)
printf(“%d”,a);
return 0;
Select one:
a. 5,4,3,2,1
b. 5 5 5 5 5
c. 4,3,2,1
d. 1 1 1 1 1
Question 6
Complete
Marked out of 2
Flag question
Question text
#include<stdio.h>
int main()
{
int a = 10;
int *p = &a;
int *ptr = p;
printf("%u",*ptr);
return 0;
}
Select one:
a. 10
b. Address
c. 2
d. Compilation error
e. None of above
Question 7
Complete
Marked out of 2
Flag question
Question text
#include<stdio.h>
int main()
union a
int i;
char ch[2];
};
union a z1 = {512};
return 0;
Select one:
a. Error: invalid union declaration
b. Error: in Initializing z2
c. No error
d. None of above
Question 8
Complete
Marked out of 2
Flag question
Question text
Question 9
Not answered
Marked out of 2
Flag question
Question text
#include <stdio.h>
struct p
int x[2];
};
struct q
int *y;
};
int main()
struct q *ptr1;
printf("%d\n", ptr1->y[1]);
Select one:
a. Compilation Error
b. 2
c. 1
d. Runtime Error
Question 10
Complete
Marked out of 2
Flag question
Question text
Question 11
Complete
Marked out of 2
Flag question
Question text
Consider scanf("%2d", &n); and the input data is 3142 then n will be assigned
Select one:
a. 42
b. 31.42
c. error
d. 31
Question 12
Complete
Marked out of 2
Flag question
Question text
int sum(int n)
if (n==0)
return n;
else
return n + sum(n-1);
Select one:
a. 40
b. 36
c. 8
d. 15
Question 13
Complete
Marked out of 2
Flag question
Question text
Question 14
Complete
Marked out of 2
Flag question
Question text
#include<stdio.h>
int main()
{
char arr[10];
arr = "world";
printf("%s",arr);
return 0;
}
Select one:
a. world
b. w
c. Null
d. Compilation error
e. None of above
Question 15
Complete
Marked out of 2
Flag question
Question text
#include <stdio.h>
int main()
int a=10;
if(10L == a)
printf("10L");
else if(10==a)
printf("10");
else
printf("0");
return 0;
Select one:
a. 10
b. 10L
c. 10L10
d. ERROR
Question 16
Complete
Marked out of 2
Flag question
Question text
Question 17
Complete
Marked out of 2
Flag question
Question text
#include <stdio.h>
int main()
int x,y;
x=(100,200);
y=100,200;
printf("x=%d,y=%d",x,y);
return 0;
Select one:
a. x=100,y=200
b. x=200,y=200
c. ERROR
d. x=200,y=100
Question 18
Complete
Marked out of 2
Flag question
Question text
Question 19
Complete
Marked out of 2
Flag question
Question text
#include<stdio.h>
int main()
int x=10,y=20;
switch(x,y)
break;
case 20:printf("CCC");
break;
Select one:
a. Compilation error
b. ccc
c. CCC
d. Warning
Question 20
Complete
Marked out of 2
Flag question