java program pls solve kindly i need today plss
Attachments:
Answers
Answered by
1
Answer: See here!
Explanation: public class s
{
public static void main(int n)
{
double x; double sum=0;int p=1;
for(int i=0;i<n;i++)
{
x=Math.sqrt(n);
if(i%2==0)
{
sum=sum+x;
}
else if(i%2!=0)
{
sum=sum-x;
}
p=p+2;
}
System.out.print(sun);
}
}
Similar questions
Math,
5 months ago
Social Sciences,
5 months ago
Math,
5 months ago
Math,
11 months ago
English,
11 months ago