Accenture19-D1 S1 MCQs V2.0
Accenture19-D1 S1 MCQs V2.0
E
Question 1
What will be the output of the following pseudocode?
Integer a, b, i
Set a=1,b=5
while(a greater than 0)
for (i from 1 to b)
Print i
end for
print new line
a--
--a
end while
Question 1
A Infinite loop
.
B No output
.
C 12345
.
D 54321
.
Question 1
A Infinite loop
.
B No output
.
C 12345
.
D 54321
.
Question 2
What will be the output of the following pseudocode?
Integer a, b, i
Set a=10,b=15
while(a greater than 0)
for (i from 1 to b incrementing by 3)
print i
end for
print new line
a decrementing by 5
end while
Question 2
A) Infinite loop
B No output
)
C 1 4 7 10 13
)
D) 1 4 7 10 13
1 4 7 10 13
Question 2
A) Infinite loop
B No output
)
C 1 4 7 10 13
)
D) 1 4 7 10 13
1 4 7 10 13
Question 3
What will be the output of the following pseudocode?
Integer a,b,c,d
Set n=10,b=15
a = n<<4
b = n>>2
c = n<<5
d = n>>3
Print a
Print b
Print c
Print d
Question 3
A) Cant be determined
B 160 2 320 1
)
C 40 2 320 0
)
D) 1 2 3 4
Question 3
A) Cant be determined
B 160 2 320 1
)
C 40 2 320 0
)
D) 1 2 3 4
Question 4
What will be the output of the following pseudocode?
B Compilation error
)
C Runtime error
)
D) 2
Question 4
A) Cant be determined
B Compilation error
)
C Runtime error
)
D) 2
Question 5
What will be the output of the following pseudocode?
Integer a[]
set a[]={1, 2, 3, 4, 5}
a[1].++;
++a[2]++;
Print a[1] , a[2]
Question 5
A) Cant be determined
B Compilation error
)
C Runtime error
)
D) 2 4
Question 5
A) Cant be determined
B Compilation error
)
C Runtime error
)
D) 2 4
Question 6
What will be the output of the following pseudocode?
B Error
)
C Hai Hai
)
D) Hai
Question 6
A) Infinite
B Error
)
C Hai Hai
)
D) Hai
Question 7
What will be the output of the following pseudocode?
B Error
)
C Hai Hai
)
D) Hai
Question 7
A) Infinite
B Error
)
C Hai Hai
)
D) Hai
Question 8
What will be the output of the following pseudocode?
B 26
)
C 24
)
D) 28
Question 8
A) 25
B 26
)
C 24
)
D) 28
Question 11
What is the output of the below pseudocode?
Integer value, n, num
Set value = 1, n = 45, num = 0
num = num >> 1
num = num + value << 1
Print num
A) 0 B) 1
C) 2 D) 4
Question 11
What is the output of the below pseudocode?
Integer value, n, num
Set value = 1, n = 45, num = 0
num = num >> 1
num = num + value << 1
Print num
A) 0 B) 1
C) 2 D) 4
Question 12
What is the output of the below pseudocode?
Integer a = 53, b = 8, c, d
c = a / b
d = c MOD 10
c = c + d
d = d - c
c = c + d
Print c, d
A) 3 -13 B) 6 -6
C) 3 4 D) 12 -6
Question 12
What is the output of the below pseudocode?
Integer a = 53, b = 8, c, d
c = a / b
d = c MOD 10
c = c + d
d = d - c
c = c + d
Print c, d
A) 3 -13 B) 6 -6
C) 3 4 D) 12 -6
Question 13
What will be output of the following pseudocode for x = 3 and y =
2?
Integer fun(int x, int y)
if(x > 1)
fun(x – 1, y + 3)
end if
print y
End function fun()
A) 8 5 2 B) 4 5 6
C) 7 6 5 D) 8 7 3
Question 13
What will be output of the following pseudocode for x = 3 and y =
2?
Integer fun(int x, int y)
if(x > 1)
fun(x – 1, y + 3)
end if
print y
End function fun()
A) 8 5 2 B) 4 5 6
C) 7 6 5 D) 8 7 3
Question 14
What will be output of the following pseudocode?
B 11
)
C 21
)
D) 3 1
Question 14
A) 3 2
B 11
)
C 21
)
D) 3 1
Question 16
What will be the output of the below pseudocode for n = 8?
Integer fun(Integer n)
if(n IS EQUAL TO 4)
return n
else
return 2 * fun(n - 2)
end if
End Function fun()
A) 32 B) 16
C) 8 D) 12
Question 16
What will be the output of the below pseudocode for n = 8?
Integer fun(Integer n)
if(n IS EQUAL TO 4)
return n
else
return 2 * fun(n - 2)
end if
End Function fun()
A) 32 B) 16
C) 8 D) 12
Question 17
What will be the output of the below pseudocode?
Integer a = 2, b = 2
while(a + 1 ? --a : b++)
Print a
A) 2 B) 0
C) 1 D) Error
Question 17
What will be the output of the below pseudocode?
Integer a = 2, b = 2
while(a + 1 ? --a : b++)
Print a
A) 2 B) 0
C) 1 D) Error
Question 18
What will be the output of the below pseudocode?
Integer arr[] = {18, 23, 45, 56, 4, 6, 45};
Integer i, x
Set x = 7
for(i = -1 less than or equal to x-2)
Print(arr[i+1])
A) 18 23 45 56 4 6 45 B) 18 23 45 56 4
C) 23 45 56 4 6 45 D) Error
Question 18
What will be the output of the below pseudocode?
Integer arr[] = {18, 23, 45, 56, 4, 6, 45};
Integer i, x
Set x = 7
for(i = -1 less than or equal to x-2)
Print(arr[i+1])
A) 18 23 45 56 4 6 45 B) 18 23 45 56 4
C) 23 45 56 4 6 45 D) Error
Question 19
What will be the output of the below pseudocode?
Integer a, b, c, d
Set b = 5, c = 6, d = 7
for(each a from 1 to 4)
c = a + b
if(((b + c) MOD 10) NOT EQUALS 0)
c = c + a
else
d = d + a
end if
end for
Print c and d
Question 19
A) 11 5
B 85
)
C 79
)
D) 13 7
Question 19
A) 11 5
B 85
)
C 79
)
D) 13 7
Question 20
What will be the output of the below pseudocode?
Integer a, b, c, d, e
Set a = 122, b = 27, c = 4, d = 0, e = 1
while(c > 0)
d = a mod b
e = e – d + a
c = c - 1
End while
Print e
A) 112 B) 433
C) 231 D) 332
Question 20
What will be the output of the below pseudocode?
Integer a, b, c, d, e
Set a = 122, b = 27, c = 4, d = 0, e = 1
while(c > 0)
d = a mod b
e = e – d + a
c = c - 1
End while
Print e
A) 112 B) 433
C) 231 D) 332
DS
Question 21
Consider the following code snippet. Which of the following is used to
create node?
struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;
Question 21
A) ptr = (NODE*)malloc(sizeof(NODE));
B ptr = (NODE*)malloc(NODE);
)
C ptr = (NODE*)malloc(sizeof(NODE*));
)
D) ptr = (NODE)malloc(sizeof(NODE));
Question 21
A) ptr = (NODE*)malloc(sizeof(NODE));
B ptr = (NODE*)malloc(NODE);
)
C ptr = (NODE*)malloc(sizeof(NODE*));
)
D) ptr = (NODE)malloc(sizeof(NODE));
Question 22
Which of the following is false about a doubly linked list?
A) Underflow
B Empty collection
)
C Overflow
)
D) Garbage Collection
Question 24
In a stack, if a user tries to remove an element from empty stack it is called
_________
A) Underflow
B Empty collection
)
C Overflow
)
D) Garbage Collection
Question 25
A queue is a ?
fun1(head->next);
printf("%d ", head->data);
}
Question 26
A) Prints all nodes of linked list
#include <stdio.h>
int main()
{
float c = 5.0;
printf ("Temperature in Fahrenheit is %.2f", (9/5)*c + 32);
return 0;
}
Question 31
A) Temperature in Fahrenheit is 41.00
D) Compiler error
Question 31
A) Temperature in Fahrenheit is 41.00
D) Compiler error
Question 32
How do you initialize an array in C?
#include <stdio.h>
void foo();
int main()
{
void foo(int);
foo(1);
return 0;
}
void foo(int i)
{
printf("2 ");
}
Question 34
A) 2
B 1
)
C Compiler error
)
B 1
)
C Compiler error
)
#include <stdio.h>
#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf("%d\n",foo(i + j, 3));
return 0;
}
Question 35
A) -8
B -4
)
D) Compiler error
Question 35
A) -8
B -4
)
D) Compiler error
Question 36
What is the output of this program?
#include <stdio.h>
#include <stdio.h>
void main()
{
while (printf("welcome"))
{
}
}
Question 36
A) Compiler error
B welcome
)
D) No output
Question 36
A) Compiler error
B welcome
)
D) No output
Question 37
What is the output of this program?
int main()
{
int a[][] = {{1,2},{3,4}};
int i, j;
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++)
printf("%d ", a[i][j]);
return 0;
}
Question 37
A) 1 2 3 4
B 4321
)
C Compiler error
)
D) GV GV GV GV
Question 37
A) 1 2 3 4
B 4321
)
C Compiler error
)
D) GV GV GV GV
Question 38
Which of the following is true about arrays in C?
B For every type T except void and function type, there can be an
) array of T.
C When an array is passed to a function, C compiler creates a
) copy of array.
D) 2D arrays are stored in column major form
Question 38
Which of the following is true about arrays in C?
B For every type T except void and function type, there can be an
) array of T.
C When an array is passed to a function, C compiler creates a
) copy of array.
D) 2D arrays are stored in column major form
Question 39
What is the output of this program?
#include <stdio.h>
#include <string.h>
int main()
{
char *str = "hello, world";
char str1[9];
strncpy(str1, str, 9);
printf("%s %d", str1, strlen(str1));
}
Question 39
A) Compiler error
B No output
)
C hello, wo 9
)
D) orld 9
Question 39
A) Compiler error
B No output
)
C hello, wo 9
)
D) orld 9
Question 40
What is the output of this program?
#include <stdio.h>
int main(int argc, char *argv[])
{
while (argc--)
printf("%s\n", argv[argc]);
return 0;
}
Question 40
A) Compiler error
B filename
)
C Segmentation fault
)
B filename
)
C Segmentation fault
)
#include<stdio.h> #include<iostream>
} return 0;
}
JAVA
import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner obj = new Scanner(System.in);
int n;
n= obj.nextInt();
System.out.print(n);
}
}
Question 41
Which of these keywords is used to make a class?
A) class
B struct
)
C int
)
D) none of the mentioned
Question 41
Which of these keywords is used to make a class?
A) class
B struct
)
C int
)
D) none of the mentioned
Question 42
Which of the following is a valid declaration of an object of class
Box?
A) malloc
B alloc
)
C new
)
D) give
Question 43
Which of these operators is used to allocate memory for an object?
A) malloc
B alloc
)
C new
)
D) give
Question 44
What is the output of this program?
class main_class
{
publ.ic static void main(String args[])
{
int x = 9;
if (x == 9)
{
int x = 8;
System.out.println(x);
}
}
}
Question 44
A) 9
B 8
)
C Compilation error
)
B 8
)
C Compilation error
)
C 00000
)
C 00000
)
A) True
B False
)
C Cannot be determined
)
D) Depends on the compiler
Question 47
Abstract class cannot have a constructor.
A) True
B False
)
C Cannot be determined
)
D) Depends on the compiler
Question 48
String in Java is a?
A) class
B object
)
C variable
)
D) character array
Question 48
String in Java is a?
A) class
B object
)
C variable
)
D) character array
Question 50
Which of the following is a type of polymorphism in Java?
A) True
B False
)
C Cannot be determined
)
D) Depends on the compiler
Question 51
Method overriding is combination of inheritance and
polymorphism?
A) True
B False
)
C Cannot be determined
)
D) Depends on the compiler
C++
C C++
• Header file: stdio.h • Header file: iostream.h
• scanf and printf functions • cin and cout are used for
are used for input/output input/output
• Does not support OOPS • It supports OOPS Concept
concept • C++ follows bottom up
• C follows the top down approach
approach
C++
C
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int main(){
int n;
int n;
scanf(“%d”, &n);
cin >> n;
printf(“%d”, n);
cout << n;
return 0;
return 0;
}
}
Question 53
Which of the below is a fundamental data type in “C++”
language?
A) bool
B) union
C) structure
D) None of the mentioned
Question 53
Which of the below is a fundamental data type in “C++”
language?
A) bool
B) union
C) structure
D) None of the mentioned
Question 54
What is the output of the below code?
#include <iostream>
using namespace std;
int main(){
int x = -1;
unsigned int y = 2;
if(x > y)
cout << "x is greater";
else
cout << "y is greater";
}
Question 54
A) x is greater
B y is greater
)
C Compiler Error
)
D) No output
Question 54
A) x is greater
B y is greater
)
C Compiler Error
)
D) No output
Question 55
What is the output of the below code?
#include <iostream>
using namespace std;
int main(){
int i = 3;
int l = i / -2;
int k = i % -2;
cout << l << endl << k;
return 0;
}
Question 55
A Compiler Error
)
B -1
) 1
C 1
) -1
D -1
) -1
Question 55
A) Compiler Error
B -1
) 1
C 1
) -1
D) -1
-1
Question 56
What is the output of the below code?
#include <iostream>
using namespace std;
int main(){
int i = -3;
int l = i / -2;
int k = i % -2;
cout << l << endl << k;
return 0;
}
Question 56
A) Compiler Error
B -1
) 1
C 1
) -1
D) -1
-1
Question 56
A) Compiler Error
B -1
) 1
C 1
) -1
D) -1
-1
Question 57
What is the output of the below code?
#include <iostream>
#include<cstring>
using namespace std;
int main (){
char str1[10] = "Hello";
char str2[10] = "World";
char str3[10];
int len ;
strcpy( str3, str1);
strcat( str1, str2);
len = strlen(str1);
cout << len << endl;
return 0;
}
Question 57
A) 5
B 55
)
C 11
)
D) 10
Question 57
A) 5
B 55
)
C 11
)
D) 10
Question 58
What is the output of the below code?
#include <iostream>
#include <string>
using namespace std;
int main (){
string str ("Steve Jobs");
cout << str.capacity() << endl;
cout << str.length()<< endl;
return 0;
}
Question 58
A) 10
10
B 10
) 15
C 15
) 10
D) Error
Question 58
A) 10
10
B 10
) 15
C 15
) 10
D) Error
Question 59
What is the output of the below code?
#include <iostream>
using namespace std;
int main(){
string str1("Hello world");
string str2(str1);
string str3(7, '$');
string str4(str1, 6, 3);
string str5(str2.begin(), str2.begin() + 5);
string str6(str1.begin(), str1.end());
cout << str1 << " " << str2 << endl;
cout << str3 << " " << str4 << endl;
cout << str5 << " " << str6 << endl;
return 0;
}
Question 59
A) Hello world Hello world
$$$$$$$ wor
Hello Hello world
B Hello world Hello world
) $$$$$$$ wor
2) We can write one function that can be used for all data types
including user defined types. Like sort(), max(), min(), ..etc.
3) We can write one class or struct that can be used for all data
types including user defined types. Like Linked List, Stack,
Queue ..etc.
B 1, 2 and 3
)
C 1, 2 and 4
)
D) 1, 2, 3 and 4
Question 60
A 1 and 2
)
B 1, 2 and 3
)
C 1, 2 and 4
)
D 1, 2, 3 and 4
)
Question 61
What is the output of the below code?
#include <iostream>
using namespace std;
template <typename T>
T myMax(T x, T y) {
return (x > y)? x: y;
}
int main() {
cout << myMax<int>(3, 10) << endl;
cout << myMax<double>(3, 7.0) << endl;
cout << myMax<char>('a', 99) << endl;
return 0;
}
Question 61
A) 10
7
c
B Error
)
C 10
) 7
99
D) None of the mentioned
Question 61
A) 10
7
c
B Error
)
C 10
) 7
99
D) None of the mentioned
Question 62
To which of the following access specifiers are applicable?
A) firend
B) friend
C) classfriend
D) myfriend
E) None of the mentioned
Question 64
Which keyword is used to declare the friend function?
A) firend
B) friend
C) classfriend
D) myfriend
E) None of the mentioned
Question 64
STL stands for
A) Tables
B Fields
)
C Records
)
D) Keys
Question 66
A relational database consists of a collection of
A) Tables
B Fields
)
C Records
)
D) Keys
Question 67
Student(ID, name, dept name, tot_cred)
In this query which attributes form the primary key?
A) Name
B Dept
)
C Tot_cred
)
D) ID
Question 67
Student(ID, name, dept name, tot_cred)
In this query which attributes form the primary key?
A) Name
B Dept
)
C Tot_cred
)
D) ID
Question 68
Which one of the following is used to define the structure of the relation,
deleting relations and relating schemas?
A) First
B Second
)
C Third
)
D) Fourth
Question 69
In the __________ normal form, a composite attribute is converted to
individual attributes.
A) First
B Second
)
C Third
)
D) Fourth
Question 70
An ________ is a set of entities of the same type that share the same
properties, or attributes.
A) Entity set
B Attribute set
)
C Relation set
)
D) Entity model
Question 70
An ________ is a set of entities of the same type that share the same
properties, or attributes.
A) Entity set
B Attribute set
)
C Relation set
)
D) Entity model
NETWORK
Question 71
The physical layer concerns with
A) bit-by-bit delivery
A) bit-by-bit delivery
A) bits
B frames
)
C packets
)
D) None of the mentioned
Question 72
The network layer concerns with
A) bits
B frames
)
C packets
)
D) None of the mentioned
Question 73
The data link layer takes the packets from _________ and encapsulates
them into frames for transmission.
A) network layer
B physical layer
)
C transport layer
)
D) application layer
Question 73
The data link layer takes the packets from _________ and encapsulates
them into frames for transmission.
A) network layer
B physical layer
)
C transport layer
)
D) application layer
Question 74
Which of the following is true with respect to TCP
A) Connection-oriented
B Process-to-process
)
C Transport layer protocol
)
D) All of the mentioned
Question 74
Which of the following is true with respect to TCP
A) Connection-oriented
B Process-to-process
)
C Transport layer protocol
)
D) All of the mentioned
Question 75
The size of IP address in IPv6 is
A) 4bytes
B 128bits
)
C 8bytes
)
D) 100bits
Question 75
The size of IP address in IPv6 is
A) 4bytes
B 128bits
)
C 8bytes
)
D) 100bits
MS-Office
Question 76
Which key is used to “Goto” tab in Ms Excel?
A) F9
B F7
)
C F6
)
D) F5
Question 76
Which key is used to “Goto” tab in Ms Excel?
A) F9
B F7
)
C F6
)
D) F5
Question 77
Which menu option can be used to split windows into two?
B Intranet Wizard
)
C Import Wizard
)
D) Export Wizard
Question 78
You can convert existing Excel worksheet data and charts to HTML
document by using the ?
B Intranet Wizard
)
C Import Wizard
)
D) Export Wizard
Question 79
Comments can be added to cells using?
A) Column
B Value
)
C Address
)
D) Cell
Question 80
What is the intersection of a column and a row on a worksheet called?
A) Column
B Value
)
C Address
)
D) Cell
THANK YOU