Assignment 9
Assignment 9
#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
return 0;
int multiplyNumbers(int n) {
if (n>=1)
return n*multiplyNumbers(n-1);
else
return 1;
#include<stdio.h>
int fibonacci(int);
int main(void)
int terms;
scanf("%d", &terms);
for(int n = 0; n < terms; n++)
return 0;
if(num == 0 || num == 1)
return num;
else
#include <stdio.h>
if (N <= 0)
return 0;
return (findSum(A, N - 1) + A[N - 1]);
int main()
return 0;
1. #include <stdio.h>
3. {
4. int pos = 0;
5.
6. if(index >= n)
7. {
8. return 0;
9. }
10.
12. {
15. }
16.
17. else
18. {
20. }
22. }
23.
25. {
29.
32. {
34. }
35.
38.
40. if (pos != 0)
41. {
43. }
44. else
45. {
47. }
48. return 0;
49. }
Q5. Write a program to perform following operations on a string input by user: a) check if it is
palindrome or not b) find duplicate elements c) compare it with another string
#include <stdio.h>
#include <string.h>
int main() {
char str[100];
scanf("%s", str);
length = strlen(str);
flag = 1;
break;
if (flag) {
} else {
printf("%s is a palindrome\n", str);
return 0;
#include <stdio.h>
#include <string.h>
int main() {
char str[100];
int i;
scanf("%s", str);
count[(int)str[i]]++;
if (count[i] > 1) {
}
return 0;
#include <stdio.h>
#include <string.h>
int main() {
int result;
scanf("%s", str1);
scanf("%s", str2);
if (result == 0) {
} else {
}
return 0;