this is the program you Wanted Code: #include "stdafx.h" #include "iostream" #include "stdlib.h" #include "conio.h" using namespace std; void main() { int a; static int m=0; cout<<"input <n> (integer): "; cin>>a; cout<<"\n"; for(int i=1;i<(a+1);i++){ if(i%3==0){ if(i%2==0){ cout<<i<<" "; m=m+1; } } } cout<<"\n number of them= "<<m; cout<<"\n program by AHA"; getch(); } mail ME AHA1376@gmail.com Good Luck