[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Program Discussion :: Strings

Home > Programs > Strings

1 / 60

Write a program to print alternate even numbers(2,6,10,14,18....).


import java.util.*;

public class AlternateEven 
    public static void main(String[] args)
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter the range: ");
        int n=sc.nextInt();
        System.out.println("Alternate even numbers upto "+n+" are: ");
        for(int i=2;i

Asked In :: Syntel Inc.

Post Your Answer Here:


Post Your Reply Here: