psuedodode capgemini

psuedodode capgemini

University

25 Qs

quiz-placeholder

Similar activities

Quantitative Aptitude Series

Quantitative Aptitude Series

University

20 Qs

Array Addresses 2024

Array Addresses 2024

University

20 Qs

Basic Python

Basic Python

University

20 Qs

Linked list 1

Linked list 1

University

20 Qs

EXCEPTION HANDLING IN PYTHON

EXCEPTION HANDLING IN PYTHON

University

22 Qs

C Programing

C Programing

University

25 Qs

C PROGRAMMING

C PROGRAMMING

University

25 Qs

Pointers in C

Pointers in C

University

24 Qs

psuedodode capgemini

psuedodode capgemini

Assessment

Quiz

Computers

University

Medium

Created by

AMAN JOLLY

Used 173+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

1 What is the output of the code given below?


#include <stdio.h>

int main()

{

char ch = 'A';

printf("%d\n", ch);

return 0;

}

A

'A'

65

97

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

2 Which of the following is not a valid declaration in C?

1.short int x;

2.signed short x;

3.short x;

4.unsigned short x;

3 and 4

1

2

All are valid

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

3 What will be the output of the following code snippet?

#include <stdio.h>

int foo(int* a, int* b)

{

int sum = *a + *b;

*b = *a;

return *a = sum - *b;

}

int main()

{

int i = 0, j = 1, k = 2, l;

l = i++ || foo(&j, &k);

printf("%d %d %d %d", i, j, k, l);

return 0;

}

1 2 1 1

1 1 2 1

1 2 2 1

1 2 2 2

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

4 What is correct about the below program?

#include

<stdio.h>

int i;

int main()

{

if (i);

else

printf("Ëlse");

return 0;

}

if block is executed.

else block is executed

It is unpredictable as i is not initialized.

Error : misplaced else

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

5 Consider the following C function

void swap ( int x, int y )

{

int tmp;

tmp = x;

x = y;

y = tmp;

}

Call swap (a, b)

Call swap (&a, &b)

swap(a, b) cannot be used as it does not return any value

swap(a, b) cannot be used as the parameters passed by value

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

6 What will be the value of s if n=127?

Read n

i=0,s=0

Function Sample(int n)

while(n>0)

r=n%l0

p=8^i

s=s+p*r

i++

n=n/10

End While

Return s;

End Function

27

187

87

120

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

7 What will be the output of the following pseudocode?

Integer n

for (n = 3; n != 0; n--)

Print n

n = n-1

end for

3 1

3 2 1

3

Infinite Loop

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?