Question: 4) Following is a main function of a C++ program, after the main function is executed, what will be showing on the output screen? int

4) Following is a main function of a C++ program, after the main function is executed, what will be showing on the output screen? int main() { Node *head=NULL, *aNode; aNode=new Node(x, head); head=aNode; aNode=new Node(52, head); head=aNode; aNode=new Node(x, head); head=aNode; aNode=new Node(23, head);

head=aNode; aNode=new Node(31, head); head=aNode; aNode=aNode->getNext(); head=aNode; aNode=aNode->getNext(); head=aNode; cout<getItem()< return 0; }

Group of answer choices

A) 52

B) x

C) 31

D) 23

5) Assume a pointer head is holding the address of the first node of an none empty linked list. Following statements will display the data item in the last node of the list. Please write the correct relational statement that should be in place of blank in the while loop as the looping condition.

Node *currentNode=head;

while( blank ){

currentNode=currentNode->getNext();

}

cout<getItem()<

Please select one of the followings:

Group of answer choices

a) currentNode!=NULL

b) currentNode==NULL

c) currentNode->getNext()!=NULL

d)currentNode->next()!=NULL

e)head!=NULL

f) currentNode=currentNode->getNext()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!