Please solve the Q.1, 2, 3 by C programming. Really need the solutions as soon as possible to practice for the exams. Thanking you.
You are given an array of integers, and you need to find the smallest and largest positive elements in the array. Take an input the array. In case the array does not contain any positive elements, print "No positives".
Input: The input consists of a single line containing N (1 <= N <= 100), the number of elements in the array. The next line contains N integers separated by a space, representing the elements of the array. The elements are in the range (-1000 <= arr[i] <= 1000).
Output: Output a single line containing the smallest and largest positive elements in the array, respectively.
Example 1:
Input: 5
-3 -7 -4 -2 -1
Output: No positives
Example 2:
Input: 5 -3 -5 -2 -1 -7
Output: No positives
Example 3:
Input: 5 -3 -5 -2 -1 1
Output: 1
You are given an array A of length N. Your task is to perform the following operations:
1. Multiply all elements at even indices of the array by 2.
2. Multiply all elements at odd indices of the array by 3.
Input: The first line contains an integer N (1 <= N <= 100), the length of the array. The second line contains N space-separated integers A[0], A[1], ..., A[N-1] (-1000 <= A[i] <= 1000), the elements of the array.
Output: Print the modified array after the following operations.
Example Input:
5
1 2 3 4 5
Output: 2 6 6 12 10
Take a number n (it is guaranteed that n <= 100) as input. Then take a string s as input. The length of string s will be equal to n. The string s contains only uppercase English alphabets (A-Z). Write a program to check whether the given string s is a palindrome or not. Print 1 if the string s is a palindrome, else print 0.
A palindrome is a string that reads the same backwards as forwards. Words like RACECAR or MADAM are palindromes, but the word HELLO is not a palindrome.
Sample Input 1:
RACECAR
Sample Output 1:
1
Sample Input 2:
HELLO
Sample Output 2:
0