#include<iostream> using namespace std; int main() { int a,b; cout<<" Enterthe number: "; cin>>a; while(a<10) { cout<<" The number is smaller than 10\n"; a++; } return 0; } code example
Example: #include using namespace std; int main() { int n; cout << "Enter an integer: "; cin >> n; if ( n % 2 == 0) cout << n << " is even."; else cout << n << " is odd."; return 0; }
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter an integer: ";
cin >> n;
if ( n % 2 == 0)
cout << n << " is even.";
else
cout << n << " is odd.";
return 0;
}