Answer and Explanation:
def loop(start, stop, step):
return_string = ""
if step == 0:
step = 1
if start > stop: # the bug was here, fixed it
step = abs(step) * -1
else:
step = abs(step)
for count in range(start, stop, step):
return_string += str(count) + " "
return return_string.strip()
Answer:
The program to this question as follows:
Program:
//header file iostream
#include<iostream> //including file for use basic function
//using name space
using namespace std;
//main method
int main() //defining main method
{
int a[3][3]; //defining two dimension array
int x,y,sum=0; //defining variables
cout<<"Enter array elements: "<<endl; //message
for(x=0;x<3;x++) // for row
{
for(y=0;y<3;y++) //for column
{
cin>>a[x][y]; //input values from user.
}
}
//loop for calculting sum.
for(x=0;x<3;x++)
{
for(y=0;y<3;y++)
{
sum=sum+a[x][y];//add all elements
}
}
cout<<"Sum: "<<sum; //print sum.
return 0;
}
Output:
Enter array elements:
1
2
3
4
5
6
7
8
9
Sum: 45
Explanation:
In the above C++ programming language code first, a header file is included then the main method is declared, inside a main method 2D array that is "a[][]", and an integer variable is defined that are "i, j, and sum". In the next line for loop is used, this loop is used two times that can be described as follows:
- The first time it is used for inserting elements from user ends.
- The second time, it uses the sum variable to add all array elements. and in the last print function that is "cout" is used for print sum variable value.
The answer is LinkedIn.
LinkedIn manage your personal identity. It also build and engage in your professional network. It access knowledge, insights and opportunities. It links people, skills and opportunities to create world largest crowd business creation system.
Answer:
PNG
Explanation:
PNG files can shrink to incredibly small sizes - especially images that are simple colours, shapes, or text. This makes it the ideal image file type for Web graphics.
Answer:
The correct answer to the following question is Drive-by hacking
.
Explanation:
Drive-by hacking is the type of hacking which comes under the cyberterrorism.
Drive-by hacking is the hacking where the hackers can access their data and steal their data, use their network services from some "safe" distance without going inside the company or an organization.
Drive-by download is the type of download of the malicious code into your mobile devices or the computers which occur by designed and it leave you to the cyberattack.