c - How to use scanf with 3 integers and '/' between them -


i have started learning c language while ago. let's want add birth date, month , year of random person. user types date, month , year in program. want displayed this! birthday: 20/12/1987 example not printf! want done scanf! problem how add '/' displayed in scanf display in program. note: date, month , year integers

thank you

it's not difficult. try asked:

for [integer]/[integer]/[integer] format, try this:

int day, month, year; scanf("%d/%d/%d", &day, &month, &year); 

Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

javascript - How to change image src on success AJAX -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -