Write a program in python to add to no using input function.
2. Write a program to get table of given no by using While Loop.
Answers
Answer:
1. Python Program to Add Two Numbers
- # This program adds two numbers provided by the user.
- # Store input numbers.
- # Store input numbers.num1 = input('Enter first number: ')
- # Store input numbers.num1 = input('Enter first number: ')num2 = input('Enter second number: ')
- # Store input numbers.num1 = input('Enter first number: ')num2 = input('Enter second number: ')# Add two numbers.
- # Store input numbers.num1 = input('Enter first number: ')num2 = input('Enter second number: ')# Add two numbers.sum = float(num1) + float(num2)
- # Store input numbers.num1 = input('Enter first number: ')num2 = input('Enter second number: ')# Add two numbers.sum = float(num1) + float(num2)# Display the sum.
- # Store input numbers.num1 = input('Enter first number: ')num2 = input('Enter second number: ')# Add two numbers.sum = float(num1) + float(num2)# Display the sum.print('The sum of {0} and {1} is {2}'. format(num1, num2, sum))
2. Program #1 : Write a c program to print multiplication table using while loop
Program #1 : Write a c program to print multiplication table using while loopint main()
Program #1 : Write a c program to print multiplication table using while loopint main(){
Program #1 : Write a c program to print multiplication table using while loopint main(){int n, i;
Program #1 : Write a c program to print multiplication table using while loopint main(){int n, i;printf("Enter a Number ");
Program #1 : Write a c program to print multiplication table using while loopint main(){int n, i;printf("Enter a Number ");scanf("%d",&n);
Program #1 : Write a c program to print multiplication table using while loopint main(){int n, i;printf("Enter a Number ");scanf("%d",&n);i=1;
Program #1 : Write a c program to print multiplication table using while loopint main(){int n, i;printf("Enter a Number ");scanf("%d",&n);i=1;while(i<=10){
Program #1 : Write a c program to print multiplication table using while loopint main(){int n, i;printf("Enter a Number ");scanf("%d",&n);i=1;while(i<=10){printf("%d * %d = %d \n", n, i, n*i);