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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:58:35+00:00 2026-05-26T04:58:35+00:00

I did a program that tells you your zodiacal sign. It compiles, but when

  • 0

I did a program that tells you your zodiacal sign. It compiles, but when I try to run it, Windows freezes.

This is the code that I used: http://codepad.org/V4WAIavW

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

int main()
{

int d, m;

printf("Bienvenido al calculador de signo zodiacal 3000\n");
printf("Por favor introduzca su mes de nacimiento\n");

scanf("%i", &m);
     system ("pause");

     switch(m)
     {
              case 1:
                   printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>20)
                   printf("Su signo es acuario\n");
                   else
                   printf("Su signo es capricornio\n");
                   break;

              case 2:
                    printf("Introduzca su dia de nacimiento\n");
                    scanf("%i", d);
                    if (d>19)
                    printf("Su signo es piscis\n");
                    else
                    printf("Su signo es acuario\n");
                    break;

              case 3:
                   printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>20)
                   printf("Su signo es Aries\n");
                   else 
                   printf("Su signo es piscis\n");
                   break;

              case 4:
                    printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>20)
                   printf("Su signo es tauro\n");
                   else
                   printf("Su signo es aries\n");
                   break;

              case 5:
                   printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>21)
                   printf("Su signo es geminis\n");
                   else
                   printf("Su signo es tauro\n");
                   break;

              case 6:
                   printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>21)
                   printf("Su signo es cancer\n");
                   else
                   printf("Su signo es geminis\n");
                   break;

              case 7:    
                   printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>23)
                   printf("Su signo es leo\n");
                   else
                   printf("Su signo es cancer\n");
                   break;

              case 8:
                   printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>23)
                   printf("Su signo es Virgo");
                   else
                   printf("Su signo es leo");
                   break;

              case 9:
               printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>23)
                   printf("Su signo es libra\n");
                   else
                   printf("Su signo es virgo\n");
                   break;

               case 10:
                printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>23)
                   printf("Su signo es escorpio\n");
                   else
                   printf("Su signo es libra\n");
                   break;

                case 11:
                 printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>22)
                   printf("Su signo es sagitario\n");
                   else
                   printf("Su signo es escorpio\n");
                   break;

                case 12:
                 printf("Introduzca su dia de nacimiento\n");
                   scanf("%i", d);
                   if (d>21)
                   printf("Su signo es capricornio\n");
                   else
                   printf("Su signo es sagitario\n");
                   break;


                 system ("pause");


    }

}

I tried with “if” instead of “switch”, but it freezes too.

  • 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-26T04:58:36+00:00Added an answer on May 26, 2026 at 4:58 am

    Your scanf() calls should pass a pointer to a place in memory where the input data will be stored.

    For example:

    scanf("%i", &d); // &d is the location in memory of d
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Did I not get enough sleep or what? This following code var frame=document.getElementById(viewer); frame.width=100;
I want to do exactly what this guy did: Python - count sign changes
I have run into this problem a lot in the past, but never really
I am trying to compile a C program through a javacode. I did it
Did you ever have the following situation: you need to store information, but a
Did about 30 minutes worth of searching, found lots of relevant info, but none
Did actually someone make already a tutorial that shows how to customize an UITableView?
I got a C++ program (source) that is said to work in parallel. However,
I'm trying to make a program that creates and reads a binary file, which
I saw this question Simple example of threading in C++ but my problem is

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.