V.Vidhya Logo

V.Vidhya

References


Q1.

What will be the output of the following programs?

You have to predict the output result without running/executing the code.


Q2.

What will be the output of the following programs?

You have to predict the output result without running/executing the code.


Q3.

What will be the output of the following programs?

You have to predict the output result without running/executing the code.


Q4.

What will be the output of the following programs?

You have to predict the output result without running/executing the code.


Q5.

What will be the output of the following programs?

You have to predict the output result without running/executing the code.


Q6.

Inside a text-based adventure game, we have a player whose health is full (100) when the game starts, now the player can get damaged on which his health will get decreased. So write a program to damage the player (i.e. decrease his health by amount 15 each time) using a function.

Expected Output:

THE GAME STARTS!

The player got damanged!
The updated player health: 75

The player got damanged!
The updated player health: 60

Q7.

Write a program to swap the values of two variables using a function.

Expected Output:

Enter the value of a: 8
Enter the value of b: 6

Values after swapping:
a: 6
b: 8

Prev Post
Functions
Next Post
Pointers