Answer On Question# 52832, Programming, C++

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Answer on Question# 52832, Programming, C++

Write an algorithm and draw flowchart that read 10 integers from the keyboard in the range 0-
100, and count how many of them are larger than 50, and display this result.
Answer:

FlowChart:
Start

Number=0;

i=1,10

Output
X=-1
Number

X<0 or X>100 End

Input x
X>50

Number=Number+1;

Program:
#include <iostream>
using namespace std;
int main(){
int x;
int number=0;
int i;
for(i=0;i<10;i++)
{
x=-5;
while((x<0)||(x>100))
{
cout<<"Input number in range (0-100): ";
cin>>x;
}
if(x>50)
number++;
}
cout<<"From 10 numbers "<<number<<" larger than 50";
return 0;
}
http://www.AssignmentExpert.com/

You might also like