class varargtest {
static int add (int ...a)
{
int sum=0;
for(int i=0;i<a.length;i++)
{
sum=sum+a[i];
}
return sum;
}
public static void main(String[] args) {
System.out.println("the sum of 2 numbers : "+add(10,70));
System.out.println("the sum of 3 numbers : "+add(110,60,40));
}
}