Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication1;
- /**
- *
- * @author Ahmed
- */
- public class JavaApplication1 {
- /**
- * @param args the command line arguments
- */
- num sum=0;
- public static void main(String[] args) {
- // TODO code application logic here
- for(int i=2;i>=30;i++)
- {
- if(i%2==0)
- {
- sum+=i;
- }
- else {
- sum+=i+1;
- }
- }
- System.out.println("sum:" + sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement