Anonymous

Write A Java Program To Find Sum Of All Even Numbers For Given N Values?

4

4 Answers

Anonymous Profile
Anonymous answered
S=0+2+4+6+8...n

import java.io.*;
import java.util.*;
public class somme{
    public static void main(String [ ] args) {
     Scanner reed=new  Scanner (System.in);
    int n,s,I;
    System.out.println("entrer la valeur n");
    n=reed.nextInt();
    s=0;
    for (I=0;I<=n;I+=2){
    s=s+I;   
    }
    System.out.println("la somme est : "+s);
    }}
Sophie Carroll Profile
Sophie Carroll answered

Get lost ... I do not want to answer your idiotic and stupid questions . Go and find your
required answer in a maths or computer textbook

Sergio Jemas Profile
Sergio Jemas answered

Hello. I wanted to find a way to significantly reduce costs, increase productivity and avoid overspending on a new IT infrastructure and this article https://redwerk.com/technologies/java-development/ helped me find a solution to my problem. Java SaaS development services are in high demand among enterprises, so you can also implement them in your business.

Answer Question

Anonymous