make program in small basic to print the sum of squares of even numbers from 1 to 20 in reverse order
Answers
Answered by
4
Answer:
use c++ program to find the answer
Answered by
2
Below are the program for the above question:
Explanation:
#include <stdio.h> // header file inclusion.
int main()// Main function declaration.
{
int Number=20,Sum=0;// variable declaration.
while(Number>1) // while loop.
{
if(Number%2==0) // condition to check even number.
Sum=Sum+(Number*Number); // sum the number.
Number--; // decrements the value.
}
printf("%d",Sum); // print the value
return 0;
}
Output:
- It will prints 1540 which is the addition value of squares of even number from 1 to 20.
Code Explanation:
In the above program, there is a while loop that adds the value of the squares of the even number from 20 to 1. In this printf is used to print the integer value because '%d' gives the value in integer format.
Learn More:
- Program :https://brainly.in/question/7087341
Similar questions