write a C++ program that print the prime number between 50 and 100
Hint: The prime number is a number that has no positive divisor other than 1 and itself
//Solution
صورة لتنفيذ البرنامجكود:#include<iostream.h> void prime() { int s=0,x,i; for ( x=50; x<100; x++) for ( i=2; i<x; i++) { if (x % i == 0) break; else { cout << x<<" is prime" <<endl; s=s+1; } } cout<<"-------------"<<endl; cout<<"sum of prime numbers ="<<s; } main() { prime(); }