0% found this document useful (0 votes)
5 views

Lab 1

The document provides examples of code snippets to perform basic arithmetic operations with mixed data types, take user input to add two numbers, swap two variable values, and concatenate strings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lab 1

The document provides examples of code snippets to perform basic arithmetic operations with mixed data types, take user input to add two numbers, swap two variable values, and concatenate strings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Write a code for the following output using basic printing fundamentals.

2. Write a program to print the following output on screen.

3. Perform the following Arithmetic Operations

Display arithmetic operations with mixed data type :


-------------------------------------------------------
 5 + 7 = 12
 11.7 5 + 8.0 = 19.75
 5 - 7 = -2
 3.7 - 8.0 = -4.3
 5 - 8.0 = -3.0
 5 * 7 = 35
 3.7 * 8.0 = 29.6
 5 * 8.0 = 40.0
 5/7=0
 3.7 / 8.0 = 0.5

4. Write a code to Add Two Numbers with User Input.


5. Write a Program to Swap Two Variables.
6. Write a program to perform the Concatenate Function on string .

You might also like