Code Arena - Round 1 Questions
Code Arena - Round 1 Questions
Code ArenA
Name: Email:
#include <stdio.h>
int main()
{
int a=6;
printf(“%d”,++a);
return 0;
}
a) 4
b) 6
c) 7
d) 5
#include <stdio.h>
int main()
{
int x = 10;
x += 5;
x *= 2;
printf(“%d”,x);
return 0;
}
a) 20
1
b) 15
c) 10
d) 30
#include <stdio.h>
int main()
{
int i = 0;
for (i = 0; i <= 3; i++)
printf("%d", i);
return 0;
}
a) 0123
b) 123
c) 012
d) 0
#include <stdio.h>
int main() {
int x = 5;
printf("%d %d %d", x++, x++, x++);
return 0;
}
a)5 6 7
b)7 6 5
c)Undefined behaviour
d)Compiler Error
2
b) stdio.h
c) malloc.h
d) memory.h
a) int ptr;
b) int *ptr;
c) *int ptr;
d) ptr int;
a) &
b) |
c) &&
d) ||
#include <stdio.h>
int main() {
int a = 5;
printf("%d", a << 2);
return 0;
}
a) 5
b) 10
c) 20
3
d) 25
a) To open a file.
b) To close a file.
c) To close a function.
d) To write data to a file.
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf("PRAVARTAN ‘25! %d\n", y);
return 0;
}
17. The format identifier ‘%i’ is also used for _____ data type.
a) char
b) int
4
c) float
d) double
#include<stdio.h>
int main() {
char c = 'A';
printf("%d", c);
return 0;
}
a) 65
b) A
c)Syntax Error
d)None of these
#include<stdio.h>
int main() {
printf("%d", 500);
return 0;
}
a) 500
b) %d
c) Syntax Error
d) None of these
a) *
b) Both are same
c) =+
d)None
5
D. Convert to string
a) 1, 1, 1, 1
b) 1, 1, 0, 1
c) 1, 0, 0, 1
d) 1, 0, 1, 1
a) *
b) |
c) -
d) _
#include<stdio.h>
#include<string.h>
int main()
{
printf("%d\n", strlen("123456"));
return 0;
}
a) 6
b) 12
c) 7
6
d) Syntax Error
a) 30
b) 22
c) 32
d) 36
27. Considering the size of char variables as one byte, what will be the size of the
array declared below?
a) 11 Bytes
b) 8 Bytes
c) 20 Bytes
d) 21 Bytes
#include <stdio.h>
int main() {
char ch = 'a' + 1;
printf("%c", ch);
return 0;
}
a) a
b) b
c) 98
d) Compilation error
7
#include <stdio.h>
int main() {
int a = 10, b = 20;
if (a > b);
printf("a is greater");
return 0;
}
a) a is greater
b) No output
c) Compilation error
d) Undefined behaviour
#include <stdio.h>
int main() {
int arr[] = {5, 10, 15, 20, 25};
printf("%d", *(arr + 2));
return 0;
}
a) 5
b) 10
c) 15
d) Compilation error