How to concatenate two integers in C

后端 未结 9 1297
执念已碎
执念已碎 2020-11-29 11:27

Stack Overflow has this question answered in many other languages, but not C. So I thought I\'d ask, since I have the same issue.

How does one concatenate t

9条回答
  •  臣服心动
    2020-11-29 11:46

    #include
    using namespace std;
    
    int main()
    {
        int a=0,b=0,count=0,c=0,t=0;
        cout<<"enter 2 no"<>a>>b;
        t=b;
    
        while(b!=0)
        {
            b=b/10;
            count++;
        }
    
        while(count!=0)
        {
            a=a*10;
            count--;
            c=a+t;
        }
    
        cout<<"concate no is:"<

提交回复
热议问题