Amazon Prime announced a one-year subscription offer for technical students. we will provide two numbers for the addition that must be use call by reference. If the answer is correct for this question, you will get the offer. Can you complete the task to win this competition?
Input:
The input lines contain the positive integers "n1" and "n2".
Output:
Print the sum of numbers using call by reference.
#include <stdio.h> long addTwoNumbers(long *n1,long *n2) {*n1 = *n1 + *n2; } int main() { long n1,n2; scanf("%ld %ld",&n1,&n2); addTwoNumbers(&n1,&n2); printf("%ld",n1); return 0; }
INPUT_1:
3 5
OUTPUT:
8
INPUT_2:
10 5
OUTPUT:
15
INPUT_3:
5 5
OUTPUT:
10
INPUT_4:
6 6
OUTPUT:
12
INPUT_5:
89 100
OUTPUT:
189
ILLUSTRATION
Morae Q!
- Find how long will it take till the next fortune year from the current year.
- Find if it’s possible to distribute all the crayons into boxes and satisfy all the conditions.
- Compute sum of numbers using call by reference.
- Compute the amount of money to be handed over with conditions.
- Find the total number of beautiful triplets in the sequence.
- Find the minimum distance between any pair of equal elements in the array.
- Compute the maximum possible value of the given equation.
- Find the age of the student at the time of joining.
- Compute the total number of photos at each restaurant .
- Find the sum of digits of the number using Union datatype.
- Generate the details of the novels in the expected format.
- Sort the student details based on their names in ascending order.
- Find a way to move the king from current position to different square on chessboard.
- Find the time differences in the two different time zones.
- Identifying the greatest number with a numerator and denominator.
- Find the Minimum number of packages to supply all the bases.
- Tower of Hanoi, A puzzle.
- Compute the sum of array of elements using recursion method.
- Find the super digit of an integer using the rules.