1.
Write a program To find sum of two integers without using ‘+’ operator.Take the numbers as p and q.
INPUT 1: -2,-3
OUTPUT 1:-5

INPUT 2: 30,20
OUTPUT 2: 50

INPUT 3: 1000 ,200
OUTPUT 3: 1200

INPUT 4 : 5 , 2.6
 OUTPUT 4: 7

INPUT 5: 1000,5
OUTPUT 5: 1005
2.

You are given an array \(A\) of \(n\) elements as follows:

 \([a_1,a_2,a_3,..........,a_n]\)

You need to find the maximum possible xor sum of any good subsequence of array\(A \).

Note: A subsequence \(S\) is defined as good if the following condition is satisfied:

For every \(a_i \)present in \(S\), \(a_{n-i+1}\) is also present in \(S\)

Input format

  • First line: Integer \(n\) denoting the size of the array
  • Second line: \(n \) space-separated integers denoting elements of the array \(A\)

Output format

  • Print a single integer denoting the maximum xor-sum of any good subsequence.

Constraints

\(1 \le N \le 40\)

\(1 \le a[i] \le 10^9\)

 

3.

Write a C++ program that will prompt the user to input ten integer values. The program will display the smallest and greatest of those values.

A sample output is shown below:
 

Enter 10 integer values

value 1: 10

value 2: 10

value 3: 20

value 4: 5

value 5: 1

value 6: 30

value 7: 24

value 8: 41

value 9: 20

value 10: 10

Greatest Value = 41

Smallest Value = 1

4.

Write a program that inputs a series of integers and passes them one at a time to function even, which determine whether an integer is even.
The function should take an integer argument and return true if the integer is even and false otherwise.

However, if 0 is entered the program should display the message

0 is neither even nor odd

5.

Write a recursive function stringReverse that takes a character array containing a string as an argument, prints the string backwards and returns nothing. The function should stop processing and return when the terminating null character is encountered.
Example :
Input : Hello
Output : olleH