Professional Documents
Culture Documents
Internal Assessment - 2
Branch: COMP
Name
Roll no.
Set no. B
Marks
(Out of 10)
Signature Teacher : Student :
Problem Definition :
C Program to Find the Biggest Number in an Array of Numbers using Recursion
Program :
1. #include <stdio.h>
2. int large(int[], int[] )
3. int main()
4. {
5. int size;
6. int largest;
7. int list[20];
8. inti;
9. printf("Enter size of the list:");
10.scanf("%d", &size);
11. printf("Printing the list:\n");
12.for (i = 0; i< =size ; i++)
13. {
14. list[i] = rand() % size;
15.printf("%d \t", list);
16. }
17. if (size = 0)
18. {
19.printf("Empty list\n");
20.}
21.else
22. {
23. largest = list[i];
24. largest = large(list, size - 1, largest);
25.printf("\nThe largest number in the list is: %d\n", largest);
26. }
27.}
29.{
30. if (position == 0)
33. {
35. {
37. }
39. }
40. Else
41. return 0;
42.}