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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:16:43+00:00 2026-05-28T08:16:43+00:00

I am trying hands on one code in C where in I need to

  • 0

I am trying hands on one code in C where in I need to check whether the value being input by the user is integer or not. I tried isdigit() but it didn’t work. May I expect any help from you guys.

while(1) {

    printf( " \n -------------Enter your choice --------------------------\n ");
    printf("\n 1. Insertion \n 2. Preorder \n 3. Inorder \n 4. Postorder \n 5. Deletion \n 6. Search \n 7. Exit \n ");
    scanf ("%d", &save_the_input );

    switch(save_the_input) {

        case 1 : 
            printf( " \n......... Please enter the numbers to create the binary tree....... \n");
            scanf ("%d", &number_of_nodes);

            printf( "\n...... Please enter the numbers one by one... \n");

            for (iterator = 0; iterator < number_of_nodes; iterator++) {
                scanf ("%d", &user_input);
                if (( user_input < 0 )) {
                    printf( " ------- You have either entered a Character or a Negative number ----- \n ");
                    printf( " ------- Please enter the Positive integer values-------------\n ");
                    main();
                }
                else {
                    root_node = insert (root_node, user_input);
                    printf("\n");
                    printf("data element inserted is %d \n ", user_input);
                }
            }
            break;
  • 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-05-28T08:16:43+00:00Added an answer on May 28, 2026 at 8:16 am

    You can use sscanf

    int num;
    ret = sscanf(line,"%d",&num);
    if (ret == 1) {
        // num contains number
    } else {
        // not a number
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm trying my hands at a css menu and I have a simple
Lately I have been trying my hands on Eclipse IDE for java development. I
I have a mystery on my hands. I am trying to learn managed C++
I am trying to migrate some code from an old naming scheme to the
I am trying to figure the best way to manage my javascript code for
I am trying to print character from boot loader using code [BITS 16] ;Tells
I need help figuring out how to create a cell like the one representing
I have several custom content types and in one specific one I need to
The situation I'm trying to solve: in my Cocoa app, I need to encrypt
In one of my views I got an INPUT field where I put my

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.