Sample codes
1. Program to Say hello!
OUTPUT:
Hello, SRON!
2. Program to check if a given number is even or odd.
TERMINAL:
Enter the value :- 17 Odd number
3. Program to use command line arguments.
TERMINAL:
sron 1 2 3 4 5 [1, 2, 3, 4, 5]
4. Program to print integers from 0 to 10,000 using for loop.
TERMINAL:
9997 9998 9999
5. Program to find factorial of a given number.
TERMINAL:
Enter the value :- 5 Factorial of 5 = 120
6. Program to find if a given number is Armstrong or not.
TERMINAL:
==> Enter the value :- 153 Yes, 153 is an Armstrong Number.
Last updated