Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main() {
// variable
int num;
int tot_sum=0;
cout<<"enter a number: ";
// read the value of n
cin>>num;
// check the multiple of 2 or 5 from 1 to n
for(int x=1;x<=num;x++)
{
// if multiple of 2 or 5 then add them
if(x%2==0 ||x%5==0)
{
tot_sum=tot_sum+x;
}
}
// print the sum
cout<<"sum of multiple of 2 or 5 is:"<<tot_sum<<endl;
return 0;
}
Explanation:
Read the number "n" from user.Check every number from 1 to n, if it is a multiple of 2 or 5 then add them to "tot_sum".When the for loop end, "tot_sum" will have sum of all the number which are either multiple of 2 or 5.Print the sum.
Output:
enter a number:11
sum of multiple of 2 or 5 is:35
in the <u>star</u> topology configuration, hosts are connected to each other through a central controller which assumes all responsibility for routing messages to the appropriate host.
Define topology.
When a geometric object <u>is stretched, twisted, crumpled, or bent without closing or opening holes, ripping, gluing, or passing through itself, certain features are kept</u>. This is known as topology in mathematics.
<u>The study of datasets using </u><u>topological </u><u>methods</u> is known as topological-based data analysis (TDA) in applied mathematics. <u>Open sets are a convenient way to define the basic </u><u>topological </u><u>notions of continuity, compactness, and connectedness</u>.
To learn more about topology, use the link given
brainly.com/question/14560531
#SPJ4
The simple interset program is a sequential program, and does not require loops and conditions
The simple interset program in Python, where comments are used to explain each line is as follows:
#This gets input for the principal amount
P = int(input("P = "))
#This gets input for the rate
R = int(input("R = "))
#This gets input for the number of years
N = int(input("N = "))
#This calculates the simple interest
I = P * R * T * 0.01
#This prints the simple interest
print("Simple Interest =",I)
Read more about simple interest at:
brainly.com/question/2294792
Answer:
// program in Python to check perfect number
#function to find number is perfect or not
def is_Perfect_Number(n):
#total variable
tot = 1
i = 2
#sum of all divisor of number
while i*i<=n:
if n%i==0:
tot = tot + i + n/i
if tot == n and n != 1:
return 1
i = i+1
return 0
#read until user enter a perfect number
while True:
#read integer
num = int(input("Input an integer: "))
#call the function
if(is_Perfect_Number(num)):
print(num,"is perfect number")
#if perfect number break
break
else:
print(num,"is not a perfect number")
#ask again
print("try again.")
Explanation:
Read number from user and then call the function is_Perfect_Number() with parameter "num".This will find the sum of all divisor of number.If sum is equal to number then it will return 1 else return 0.If the number is not perfect then it will again ask to enter a number until user enter a perfect number.
Output:
Input an integer: 24
24 is not a perfect number
try again.
Input an integer: 28
28 is perfect number
Answer:
Network.
Explanation:
The Transmission Control Protocol/Internet Protocol (TCP/IP) model is a standard networking protocol which allows network devices such as routers, switches, and host computers to interconnect and communicate with one another over a network. The Transmission Control Protocol/Internet Protocol (TCP/IP) model comprises of four (4) layers and these includes;
I. Application layer.
II. Transport layer.
III. Internet layer.
IV. Network layer.
The network layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for delivering data between two nodes.
Basically, this layer known as network layer is the fourth layer of the Transmission Control Protocol/Internet Protocol (TCP/IP) model and it is typically responsible for the transmission of packets from one network device to another.