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 8211119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:19:17+00:00 2026-06-07T10:19:17+00:00

I just wanna know how i can save the value and the index for

  • 0

I just wanna know how i can save the value and the index for my array “cadenaNumeros” in a integer, if the user entry is something like this : 123456789 or 48934013 or 183853025… etc.

I was thinking do it with a FOR, but my code didn´t work.

For example: if we have this array “123456789” the value will be 2 and index = 1 and this numbers save it in a integer.

I’m programming in ANSI C.

#include <stdio.h>
#include <stdlib.h>

void main()
{
    int a = 0, i = 0, indice, numero[20], vuelta, quedan, x;
    int cadenaNumeros[20000];
    int num, num2;

    printf("\n\nEscribe el numero de palancas: ");
    scanf("%d", &num2);

    printf("\n\nEscriba el numero de la palanca roja: ");
    scanf("%d", &num);

    printf("\n\nIntroduzca una cadena de numeros: ");
    scanf("%d", &cadenaNumeros);

    for(i = 0; cadenaNumeros[i] < num2; i++); {
        cadenaNumeros[0] == numero[x];
        printf("%d", numero[x]);
    }

    system("PAUSE");
    return 0;
}
  • 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-07T10:19:19+00:00Added an answer on June 7, 2026 at 10:19 am
    int index = -1, i = 0;
    
    // Assuming num2 is the number you're searching for
    // And the array size is 20000
    for( ; i < 20000; i++) {
        if( cadenaNumeros[i] == num2) {
            index = i;
            break;
        }
    }
    
    if( index != -1) {
        printf( "Found %d at index %d\n", num2, index);
    } 
    else {
        printf( "Number not found\n");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm sorry if there is a question like this i just wanna know, i'm
I just wanna know how to do an if -statement in simple HTML. Like
I just wanna ask this very trivial question, I do not know if this
Just for the sake of curiosity I wanna know this.. I know scope of
i am using vb.net i just wanna ask if we can place a picture
I just wanna know if it is possible to pause a playing SWF file
I just wanna know if there exists simple drawer (move up and down certain
Ok, I need keys to be preserved within this array and I just want
I am new to LINQ and just wanna know; is there any application in
I am a new newbie to android. Just wanna know how could we create

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.