TCS Coding Question


                   TCS Coding Questions

         


More Experience will be Shared soon...!!!

If you like SimpleWay2Code and would like to contribute, you can also write an article and  mail your article to simpleway2code@outlook.com. See your article appearing on the  SimpleWay2Code main page and help others.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Post a Comment

4 Comments

  1. Consider the below series:

    1, 2, 1, 3, 2, 5, 3, 7, 5, 11, 8, 13, 13, 17, …

    This series is a mixture of 2 series – all the odd terms in this series form a Fibonacci series and all the even terms are the prime numbers in ascending order.

    Write a program to find the Nth term in this series.

    ReplyDelete
    Replies
    1. this is your program bro an thank you for question

      #include
      #include
      int main()
      {
      int j,k,prime=1,i=2,m=1,x=1,y=1,o,fib,n,output;
      scanf("%d",&n);
      for(o=0;o2){
      fib=x+y;
      output=i;
      x=y;
      y=fib;
      }
      m++;
      }
      }
      printf("%d",output);
      return (0);
      }

      Delete
  2. Replies
    1. just click the link
      https://www.dropbox.com/s/7vzanhntmfrak22/series.c?dl=0

      Delete