Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Program Discussion :: Basics

Home > Programs > Basics

9 / 265

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: