1) Write a program in C to calculate the sum of first n terms (n≥1) of the following series by using ‘ for’ loop. 1 - 3 + 5 - 7 + 9 - ...
2) Write a program in C to convert the binary number to its corresponding octal number.
3) Given are two one dimensional arrays A and B stored in ascending order. Write a program to merge them into single sorted array C which contains every element of A and B in ascending order.
4) Given an array of characters, write a C program to reverse an array.
5) Write down a program in C to calculate the length of a string.
6) Write down a C program which reads a line of text and counts all occurrences of a particular word.
7) What do you mean by a macro? Write a nested macro that gives the minimum of three values.
8) What is parameter passing? Describe call by value with suitable example.
9) Write down a C program fragment using “do...while” construct to print out even numbers between 10 to 100 making sure that three numbers are written per line.
10) Write a recursive function in C to compute the value of xn where n is a positive integer and x has a real value.
11) Explain the syntax for defining the composition of a structure. Describe the difference between declaring a structure and defining a structure variable.
12) Write down a program in C which reads n elements of an integer array from a file and outputs the sum of all elements into the same file.