we are writing the program of Var Args This website
package com.ritesh;
import java.util.Scanner;
public class argsfhf {
static int args(int...args)
{
int sum=0;
for(int E:args)
{
sum+=E;
}
return sum;
}
public static void main(String[] args) {
System.out.println("The sum of the enter number is "+args(4,3,5));
}
}
Comments
Post a Comment