Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:09:57+00:00 2026-06-14T04:09:57+00:00

I want to concatenate two integers, that is not adding their values, but join

  • 0

I want to concatenate two integers, that is not adding their values, but join them.

For example:

int a=2,b;
cin>>b;
a=a+3;

a should be something like 23 instead of 5.

How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:09:58+00:00Added an answer on June 14, 2026 at 4:09 am

    A simple method would be to multiply the number by 10 and then add the new integer.

    Edit: Other answers were more accurate. In the case where a number can be above 10 you will need to either treat them as strings and then convert back to int (itoa on the c_str()). If you want to keep them as int, you will need to know which power of 10 contains your new value and multiply the number by this power of 10 to make enough room for the new number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to concatenate two form text field values and assign them to my
I have two environment variables in apache config, I want to concatenate them into
I'm trying to create a program that will concatenate (add two lists of integers
I have two UIImageView 's, and I want to concatenate them both to be
I want to concatenate the values of two columns into one when retrieving all
Suppose that you have two huge files (several GB) that you want to concatenate
I want to concatenate two strings without any whitespaces between the strings that are
I want to concatenate two const char* but when I do this I got
I have two AFP files and I want to concatenate them together, how can
I have two unicode string '가' and 'ㄱ' and I want to concatenate them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.