import java.util.Scanner;
public class test {
public static void main(String[] args)
{
int sum1=0;
int sum2=0;
Scanner m=new Scanner(System.in);
System.out.println("enter the first num");
int num;
num=m.nextInt();
for(int i=0;i<=num;i++)
{
if(i%2==0)
{
sum1=sum1+i;
}
sum2=sum2+i;
}
*/
/*
int count , num1 = 0, num2 = 1;
Scanner m=new Scanner(System.in);
count=m.nextInt();
System.out.print("Fibonacci Series of "+count+" numbers:");
for (int i = 1; i <= count; ++i)
{
System.out.print(num1+" ");
/* On each iteration, we are assigning second number
* to the first number and assigning the sum of last two
* numbers to the second number
*/
// int sumOfPrevTwo = num1 + num2;
// num1 = num2;
// num2 = sumOfPrevTwo;
//
No comments:
Post a Comment