By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 1,966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

sum in command line argument

P: 1
Expand|Select|Wrap|Line Numbers
  1. class N2
  2. {
  3.   public static void main(String[] args){
  4.  
  5.       int a,b,c;
  6.  
  7.       int  sum=0;
  8.  
  9.       for(int i=0;i<=args.length;i++)
  10.       {      
  11.           {
  12.  
  13.               sum+=i;
  14.  
  15.           }
  16.  
  17.           System.out.println(sum);
  18.      }
  19.  
  20. }
  21. }
1 Week Ago #1
Share this Question
Share on Google+
1 Reply


gits
Expert Mod 5K+
P: 5,353
do you have a question regarding the code you posted?
1 Week Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.