Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Series: 1+2+3+4+..N
3. C program to find the sum of Natural Number/Factorial of Number of all natural numbers from 1 to N.
Series: 1/1! + 2/2! + 3/3! + 4/4! + ... N/N!
13. WAP to interchange the largest and the smallest number in an array.
29. C program to replace all EVEN elements by 0 and Odd by 1 in One Dimensional Array.
30. C program to Add and Subtract of Two One Dimensional Array elements.
31. C program to sort an one dimensional array in descending order.
33. Consider a scenario where there are two classes A and B having 30 students each. A test was conducted for
both the classes in a single room and student having same class roll number but from different classes was
made to sit together and as a result they copied from each other and scored equal marks. Wap in ‘C’ to
compute the marks of class B students based on the marks of class A students (using Arrays).
34. Write a program in ‘C’ to store (in an array) and print the roll numbers of students beginning from m to n.
36. A program P reads in 500 integers in the range [0..100] representing the scores of 500 students. It then
prints the frequency of each score above 50. What would be the best way for P to store the frequencies?
Write the above program in ‘C’.
37. In USA President election, there are 50 states, you have to create two arrays HILLARY and TRUMP store
the number of vote polled in each state. Write a program to show result in each state and who is winner?
38. Students are standing in sequence of their roll number. Write a program to print the roll numbers of
alternate students.
39. There is a class of 10 students having roll numbers from 1 to 10. One of the students in class is missing.
How will you find the roll no. of that missing student?
40. Find the binary equivalent of an integer number using array.
41. An array stores the roll number of all present students. Write a program to search a student in a class by
using their roll no. If roll number is found in this array, then find the position.
42. Write a C program to delete an element from the array. It should cover the following cases:
a. The index of deleted element is provided
b. The deleted element is provided by user.
c. If index or deleted element is not found in the array, then print the message “Deleted Element not
found” .
43. Write a C program to insert an element at the nth position by checking that array index condition.
44. Write a program to sort the elements of an array in ascending order using Bubble Sort.
45. An array contains n numbers ranging from 0 to n-2. There is exactly one number is repeated in the array.
You need to write a program to find that duplicate number. For example, if an array with length 6 contains
numbers {0, 3, 1, 2, 3}, then duplicated number is 3.