SJIT ECE  PRACTICE TEST HCL @ 13/3/24

SJIT ECE PRACTICE TEST HCL @ 13/3/24

Professional Development

20 Qs

quiz-placeholder

Similar activities

Pre-Assessment- C,C++, Data Structure & SQL_10th June 24

Pre-Assessment- C,C++, Data Structure & SQL_10th June 24

Professional Development

20 Qs

C Quiz 1

C Quiz 1

Professional Development

20 Qs

C Programming Tutorial 2 (Chapter 2)

C Programming Tutorial 2 (Chapter 2)

Professional Development

15 Qs

PythonDS

PythonDS

Professional Development

21 Qs

day4

day4

Professional Development

15 Qs

HACKATHON HUSTLE(ROUND 2)

HACKATHON HUSTLE(ROUND 2)

Professional Development

20 Qs

Day3

Day3

Professional Development

15 Qs

day5

day5

Professional Development

21 Qs

SJIT ECE  PRACTICE TEST HCL @ 13/3/24

SJIT ECE PRACTICE TEST HCL @ 13/3/24

Assessment

Quiz

Professional Development

Professional Development

Medium

Created by

DINESH ADIKESAVAN

Used 3+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>

int main()

{

int a = 3,

b = 5;

int t = a;

a = b;

b = t;

printf("%d %d", a, b);

return 0;

}

5 3

3 3

3 5

5 5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

#include <stdio.h>

int main()

{

int a[] = {1, 2, 3, 4};

int sum = 0;

for(int i = 0; i < 4; i++) { sum += a[i];

}

printf("%d", sum);

return 0;

}

1

4

10

20

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet?

int main() 
{
	int sum = 2 + 4 / 2 + 6 * 2;
	printf("%d", sum);
	return 0;
}

2

15

16

18

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>
void solve() {
    int a[] = {1, 2, 3, 4, 5};
    int sum = 0;
    for(int i = 0; i < 5; i++) {
        if(i % 2 == 0) {
            sum += *(a + i);
        }
        else {
            sum -= *(a + i);
        }
    }
    printf("%d", sum);
}
int main() {
	solve();
	return 0;
}

2

15

3

syntax error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>
void solve() {
    int first = 10, second = 20;
    int third = first + second;
    {
        int third = second - first;
        printf("%d ", third);
    }
    printf("%d", third);
}
int main() {
	solve();
	return 0;
}

10 30

30 10

10 20

20 10

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>
void solve() {
    int a = 3;
    int res = a++ + ++a + a++ + ++a;
    printf("%d", res);
}
int main() {
	solve();
	return 0;
}

12

20

24

18

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of x in the following code snippet?

#include <stdio.h>
void solve() {
    int x = printf("Hello");
    printf(" %d", x);
}
int main() {
	solve();
	return 0;
}

10

5

1

0

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?