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

c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

736


What is return type in c?

639


What is the difference between memcpy and memmove?

606


Is c procedural or functional?

588


Can we use any name in place of argv and argc as command line arguments?

610






A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

649


What are types of preprocessor in c?

621


What are the header files used in c language?

589


What are nested functions in c?

567


What does return 1 means in c?

589


What is calloc()?

629


Explain how do you convert strings to numbers in c?

597


How will you find a duplicate number in a array without negating the nos ?

1649


Why c is called free form language?

574


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1315