Now, i input 1.5, obviously, it will show 1. But how can the program check that i just input 1.5 so that it will show an error for non integer input?
#include<iostream>
using namespace std;
int main(){
int k;
cout<<"Input: ";
cin>>k;
cout<< k ;
}