c++ program to analyse data