Here goes the code. Using For Loop [code]class sum { public static void main(String args[]){ int n = 5; //just taking n=5 int sum = 0; for(int i=1;i<=n;i++) ...
確定! 回上一頁