What is the difference between %d and %*d in C

Answer Posted / nithya

%d print the value for example
int x=2;
printf("x=%d",x);

output:

x=2

%*d print the value for example
int x=2;
printf("x=%*d",x);

output:

x= 2

the output two space(x=2) next the value will be display
(x=6) the output 6 space next the value will be display

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is #line used for?

608


How is actual parameter different from the formal parameter?

591


Differentiate between full, complete & perfect binary trees.

672


Can you apply link and association interchangeably?

679


What is the use of printf() and scanf() functions?

635






Explain how can a program be made to print the name of a source file where an error occurs?

689


Explain what is the benefit of using const for declaring constants?

614


What do you mean by recursion in c?

626


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2237


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

635


What is substring in c?

641


What are the types of functions in c?

573


How does sizeof know array size?

629


What is struct node in c?

620


Why isn't it being handled properly?

645