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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:12:43+00:00 2026-06-08T03:12:43+00:00

I tried to run this program in Turbo C but couldn’t decipher the output.

  • 0

I tried to run this program in Turbo C but couldn’t decipher the output. What does this %*c mean? Any help would be appreciated.

int dd,mm,yy;
printf("\n\tEnter day,month and year");
scanf("%d %*c %d %*c %d",&dd,&mm,&yy);  // what does %*c mean ?
printf("\n\tThe date is : %d %d %d",dd,mm,yy);

OUTPUT

Enter day, month and year 23
2
1991
3
5
The date is: 23 1991 5
  • 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-08T03:12:45+00:00Added an answer on June 8, 2026 at 3:12 am

    The * in a scanf() format means ‘read the data but do not assign it to a variable in the argument list’. In context, it means you could type:

    18/07/2012
    

    and get the day (18), month (7) and year (2012) interpreted correctly. The spaces in the format string are crucial and complicate things. Normally, %c reads the next character, even a space, but the spaces around the %*c conversion specifiers deal with white space, so the code needs a non-blank character to consume.

    Hence the observed behaviour that when you typed:

    23 2 1991 3 5
    

    the 2 (on its own) was consumed by the first %*c and the 3 (on its own) was consumed by the second.

    This is Standard C and not a peculiar feature of Turbo C (which the first edition of the question specified, but the question has been edited to remove the reference to Turbo C since I first wrote this answer).

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

Sidebar

Related Questions

Have tried to compile and run this program, but have received this error message
I tried to run this program but this gives a runtime error(StackOverflowError). If in
In order to test bool i/o, I tried to run this short program: #include
I tried to run this perl5 program: #!/usr/bin/env perl use strict; use warnings; use
I tried to run this code: #define ROW_CNT 8; #define COLUMN_CNT 24; #define FIRST_COLUMN
I am logged into my server as root and tried to run this command:
How do I run this command with subprocess? I tried: proc = subprocess.Popen( '''ECHO
I just tried to run my test app and I got this error: 2012-06-16
This problem was discovered when I tried to run the Android emulator in Eclipse.
im really desperate right now, ive tried everything. Everytime i run my app this

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.