Computer Science, asked by krish53589295, 1 year ago

make program to print the sum of squares of even numbers from 1 to 20 in reverse order​


mn121: which language???

Answers

Answered by mn121
4

I know java and c++ , so i am writing using it...

java

public class sum

{

public static void main(String args[])

{

int s=0,i;

for(i=20;i>=1;i-=2)

{

s=s+(i*i);

}

System.out.println("sum = "+s);

}

}

c++

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int s=0,i;

for(i=20;i>=1;i=i-2)

{

s=s+(i*i);

}

cout<<"sum = "<<s;

getche();

}

hope it helps you...

please mark it as brainliest...

^_^


mn121: please mark it as brainliest...
Similar questions