c++ program to separate digits of a numberc++ program to separate digits of a number: |
1)#include<iostream>
2)using namespace std
3)int main()
4){
5)int number,digit,n;
6)cout<<"enter digits of number";
7)cin>>n;
8)cout<<"Enter a number";
9)cin>>number;
10)for(int i=0;i<n;i++)
11){
12) digit=number % 10;
13) cout<<digit<<", ";
14) number=number / 10;
15)}
16)return 0;
17)}
DESCRIPTION:
This is a c++ program to separate digits of a number.program to separate digits of a number in c++.This program is about how to seperate digits of a number in c++.
c++ program to separate digits of a number |
0 Comments