write a program that takes a four digits integer from user and shows the digits on the screen separately i.e. if user enters 7531, it displays 7, 5, 3, 1 separately.

You could use something like:

  string s;
  cin >> s;
  for(char c : s) cout << c << ", ";

but you need to solve how to not write the last ',' yet. Also this has the problem to work with letters and numbers. Anyway, this is a start point for your work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.