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

  • SEARCH
  • Home
  • 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 7998757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:18:16+00:00 2026-06-04T15:18:16+00:00

I am writing some functionality for a visual node based CAD program that will

  • 0

I am writing some functionality for a visual node based CAD program that will not allow for me to loop so I need a workaround to enumerate a list of numbers. I am an architect with very little programming experience so any help would be great.

A have an array of numbers(numArray) coming in as such 0,1,2,3,4… (first column) I need to take those numbers and convert them into their counterpart for column 1,2,3,4 without using any loops or nested loops.

   numArray 1 2 3 4
        -----------
        0 = 0|0|0|0
        1 = 0|0|0|1
        2 = 0|0|0|2
        3 = 0|0|0|3
        4 = 0|0|1|0
        5 = 0|0|1|1
        6 = 0|0|1|2
        7 = 0|0|1|3
        8 = 0|0|2|0
        9 = 0|0|2|1
        10= 0|0|2|2
        12= 0|0|2|3
        13= 0|0|3|0
        14= 0|0|3|1
        15= 0|0|3|2
        16= 0|1|3|3
        17= 0|1|0|0
        18= 0|1|0|1
        19= 0|1|0|2
        20= 0|1|0|3
        21= 0|1|1|0
        22= 0|1|1|1
        23= 0|1|1|2
        24= 0|1|1|3

I have figured out column 4 by implementing the following:

int column4 = numArray % 4;

this works and creates the numbers as such 0,1,2,3,0,1,2,3…. this is great however I am not sure how to use the num array coming in to produce column 3 2 and 1. Again I have very little programming experience so any help would be great.

  • 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-04T15:18:18+00:00Added an answer on June 4, 2026 at 3:18 pm

    You’re converting the input to base 4 notation, so this will do the job:

    int input[] = {0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24};
    
    for (int i = 0; i < sizeof(input)/sizeof(input[0]); i++)
    {
        int c1, c2, c3, c4;
    
        c4 = input[i] % 4;
        c3 = (input[i] / 4) % 4;
        c2 = (input[i] / 16) % 4;
        c1 = (input[i] / 64) % 4;
    
        printf("%d = %d\t%d\t%d\t%d\n", input[i], c1, c2, c3, c4);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing some kind of IPC functionality and need to pass certain resources
I am writing some functionality using jQuery that i normally handle with a page
I'm writing a Safari Extension that adds some functionality to a web page that
I'm writing a Python program that will use Twisted to connect to a TCP
I am writing unit tests in visual studio 2010. For test some functionality, I
I am writing an Android application that uses some functionality that has been published
I'm writing a small GUI app that contains some editor functionality, and something that
I am thinking about writing a windows service that will turn a certain functionality
I'm writing some browser side dynamic functionality and using HTTP Basic Auth to protect
I'm writing an assignment which involves adding some functionality to PostgreSQL on a Solaris

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.