V.Vidhya Logo

V.Vidhya

Strings


Q1.

What will be the output of the following programs for the mentioned input test cases?

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


Q2.

Write a program that asks the user to enter their full name and their age. As output, tell the user the sum of their age and the number of characters in their name.

For simplicity, count any spaces in the name as a character.

Expected Output:

Enter your full name: Magan Chhapri
Enter your age: 32

Magan Chhapri's age + length of name is: 45

Q3.

Write a program that asks for the full name and age of two people, then prints which person is older.

Enter the name of person 1: Gagan Rangeela
Enter the age of Gagan Rangeela: 37

Enter the name of person 2: Chhagan Sureela
Enter the age of Chhagan Sureela: 44

Chhagan Sureela (age 44) is older than Gagan Rangeela (age 37).

Prev Post
Loops
Next Post
Functions