diff --git a/Array-Sorting-Without-Function/JayAkbari/bubblesort.c b/Array-Sorting-Without-Function/JayAkbari/bubblesort.c new file mode 100644 index 0000000..a99e9a2 --- /dev/null +++ b/Array-Sorting-Without-Function/JayAkbari/bubblesort.c @@ -0,0 +1,39 @@ + +#include +#define MAXSIZE 10 + +void main() +{ + int array[MAXSIZE]; + int i, j, num, temp; + printf("Enter the value of num \n"); + scanf("%d", &num); + printf("Enter the elements one by one \n"); + for (i = 0; i < num; i++) + { + scanf("%d", &array[i]); + } + printf("Input array is \n"); + for (i = 0; i < num; i++) + { + printf("%d\n", array[i]); + } + /* Bubble sorting begins */ + for (i = 0; i < num; i++) + { + for (j = 0; j < (num - i - 1); j++) + { + if (array[j] > array[j + 1]) + { + temp = array[j]; + array[j] = array[j + 1]; + array[j + 1] = temp; + } + } + } + printf("Sorted array is...\n"); + for (i = 0; i < num; i++) + { + printf("%d\n", array[i]); + } +} \ No newline at end of file diff --git a/Nth-Digit-Fibonacci/JayAkabri/Main.java b/Nth-Digit-Fibonacci/JayAkabri/Main.java new file mode 100644 index 0000000..e51aa57 --- /dev/null +++ b/Nth-Digit-Fibonacci/JayAkabri/Main.java @@ -0,0 +1,34 @@ +import java.io.*; +import java.util.*; +public class Main { + + public static void main(String[] args) { + + int n = 1000, t1 = 0, t2 = 1,count=1,no=0; + + Scanner sc = new Scanner(System.in); + + System.out.println("Enter Number"); + no = sc.nextInt(); + + // System.out.print("Upto " + n + ": "); + while (count +int pelindrome(int n) +{ + int t,r = 0; + t=n; + while(t!=0) + { + r=r*10; + r=r+(t%10); + t=t/10; + } + if(r==n) + return 1; + else + return 0; +} +void main() +{ + int k,d,i; + printf("enter number: "); + scanf("%d",&k); + i = k + 1; + while(1) + { + d=palindrome(i); + if(d==1) + break; + i++; + } + printf("%d",i); +}