what is the difference between %d and %*d in c languaga?

Answer Posted / azad sable,chiplun.

In first case i.e. '%d' the '%' indicates that the
conversion specification follows. And 'd' known as data
type charactor indicates that the no. to be read is in
intiger mode.
* is an input field which specifie field width.
example
scanf("%d%*d%d",&a,&b);
will assign the data 123 456 789 as follows.123 to a 456
skipp because of * 789 to b.

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are the outer parentheses in return statements really optional?

545


Can we add pointers together?

590


Write the Program to reverse a string using pointers.

597


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

1837


Explain what are the __date__ and __time__ preprocessor commands?

570






What is malloc() function?

607


What is hashing in c?

613


How can I find the modification date and time of a file?

579


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3705


Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"

1559


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1437


Why functions are used in c?

555


Explain what is the benefit of using enum to declare a constant?

561


What is hash table in c?

543


What is the right way to use errno?

596