PRATIAN
Exam
Category
1,1,2,12,14,26,40,264,304,568,3488.... N
whats the logic behind this ?
Read Solution (Total 10)
-
- void main()
{
int a=0, b=1, sum=0, i, n=3488;
for(i=1; sum - 9 years agoHelpfull: Yes(23) No(6)
- public static void main(String[] args) {
int T1=1,T2=1,T = 0,n=15;
System.out.println(T1+","+T2);
for(int i=3;i - 9 years agoHelpfull: Yes(7) No(3)
- //1,1,2,12,14,26,40,264,304,568,872,.......
public class Logic4 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int X1=1,X2=1;
int X3,X4;
int[] arr=new int[4];
for(int i=0;i - 9 years agoHelpfull: Yes(3) No(7)
- the logic is that the sum or first two terms is equal to the third term and so on
- 9 years agoHelpfull: Yes(3) No(1)
- #include
#include
void main(){
int i,n,x1=1,x2=1,x3,x4;
printf("Enter the no of term in series: ");
scanf("%d",&n);
while(n!=0)
{
x3=x1+x2;
x4=(x2+x3)*4
printf("%d%d%d%d",x1,x2,x3,x4);
x1=x3+x4;
x2=x1+x4;
n--;
}
getch();
} - 9 years agoHelpfull: Yes(3) No(0)
- #include "stdio.h"
int main()
{
int a=0,b=1,sum=0,i,n=3488;
for(i=1;sum - 9 years agoHelpfull: Yes(0) No(5)
- x1+x2=x3;
(x2+x3)*4=x4; - 9 years agoHelpfull: Yes(0) No(2)
- class Aaaa
{
public static void main(String[] args)
{
System.out.println("Hello ");
int i=1,j=1,m=1;
System.out.println(i);
for(int k=0;k - 9 years agoHelpfull: Yes(0) No(1)
- (1, 1, 2, 12, 14, 26, 40, 264, 304, 568, 3488)
1+1 = 2
(1+2)*4 =12
2+12 = 14
12+14 = 26
14+26= 40
(26+40)*4= 264
40+264= 304
264+304 = 568
(304+568)*4 = 3488
That is if there is a sequence as X1,X2,X3,X4.....
then X1 + X2 = X3
(X2+X3)*4= X4 - 8 years agoHelpfull: Yes(0) No(0)
- import java.util.Scanner;
public class HelloWorld
{
public static void main(String []args)
{
int i,n,x1=1,x2=1,x3,x4;
System.out.println(x1);
Scanner s= new Scanner(System.in);
n=s.nextInt();
while(n!=0)
{
x3=x1+x2;
x4=(x2+x3)*4;
System.out.println(x1);
System.out.println(x3);
System.out.println(x4);
x1=x3+x4;
x2=x1+x4;
System.out.println(x1);
System.out.println(x2);
n--;
}
}
} - 7 years agoHelpfull: Yes(0) No(1)
PRATIAN Other Question