Answer:
#include <iostream>
using namespace std;
int main()
{
int myArray[] = {-11,3,-8,30,-2,0,5,7,-100,44};
int n = sizeof(myArray)/sizeof(myArray[0]);
for(int i=0;i<n;i++){
if(myArray[i]>=0){
cout<<myArray[i]<<endl;
}
}
return 0;
}
Explanation:
First include the library iostream in c++ programming for using the input/output function.
Then, create the main function and define the array with the elements which contain both positive element as well negative elements.
after, use the for loop for traversing the array and inside the loop take the conditional statement for check if element in the array is positive.. if it true then print the element on the screen with separate line.
Answer:
Locale unaware
'{:,}'.format(value) # For Python ≥2.7
f'{value:,}' # For Python ≥3.6
Locale aware
import locale
locale.setlocale(locale.LC_ALL, '') # Use '' for auto, or force e.g. to 'en_US.UTF-8'
'{:n}'.format(value) # For Python ≥2.7
f'{value:n}' # For Python ≥3.6
Relational operators allow an end user to <u>compare</u> numbers.
<h3>What are
relational operators?</h3>
Relational operators can be defined as a programming language construct which allows an end user to compare both numbers and char values.
Also, it can be used to determine whether one number is less than (<), greater than (>), equal to (=), or not equal to another.
This ultimately implies that, relational operators allow an end user to <u>compare</u> numbers.
Read more on relational operators here: brainly.com/question/14995818
#SPJ1
Answer:
1/2 of 1/2 is 1/4 <em>or </em>0.25
Explanation: