• + 5 comments

    use double to declare data type as double a ,b,c; while scaning scanf("%lf",&a); while printing printf("%0.lf",a); // 0.lf restricts the decimal point to zeroth position which is an integer

    • + 1 comment

      thank you.. thanks allloott... :)

      • + 0 comments

        Very easy problem for python users.

        Hackerrank - Fibonacci Modified Solution

    • + 2 comments

      i tried that too. even used long double. that's not working.. can u explain?

      • + 1 comment

        in second test case its a 20 digit and crossing number soo long double is not enough to perform tis programme

      • + 0 comments

        u have to convert number into array/string, like if number is 543656 then store it in array like |3|4|3|6|5|6|. then write seperate function to add and multiply these array/string and then try to find out fibo.

    • + 2 comments

      can u help? what is wrong with this????

      void fibonacciModified(double t1, double t2, double n) { int i; double arr[20]; arr[0]=t1; arr[1]=t2; for(i=2;i<20;i++) { arr[i]=t1+t2*t2; t1=t2; t2=arr[i]; } for(i=0;i<20;i++) { if((i+1)==n) printf("%0.lf",arr[i]); } }

      • + 0 comments

        double will not work.. The no. is too large. If you are doing in Java, there is a datatype for very large no. but in C, you have to take the no. as string and do the addition of two no.s by writing a function for addition of two strings.

      • + 0 comments

        use python or java big integer because double will not work

    • + 0 comments

      thanks buddy