Skip to content

Instantly share code, notes, and snippets.

@gahan9
Last active August 26, 2018 16:41
Show Gist options
  • Save gahan9/f44f96d0a894fa9dec1daf2344c0dce7 to your computer and use it in GitHub Desktop.
Save gahan9/f44f96d0a894fa9dec1daf2344c0dce7 to your computer and use it in GitHub Desktop.
Linux Lab Problems (ce006)

Lab Assignment

  1. Get name of user as user input and greet it. (Hint: use read and echo)

input

XYZ

output

Hello, XYZ

  1. Get two numbers from input, do addition and print its result (Hint: evaluate expression)

input

10
5

output

10 + 5 = 15

  1. Get any two numbers from input, do division and do rounding up to 2 decimal places

input

20
3

output

6.67

or

6.666

Explanation input

20
3

output

$ 6.67
  or
$ 6.666

  1. Print All even numbers between 1 to 50 (Hint: use for loop)

output

2
4
6
.
.
.
50

  1. Get an input number from user and print sum of numbers from 0 to user input number (if user enters 20 then sum of first 20 numbers) (Hint: use for loop)

input

20

output

$ 210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment