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

Answer Posted / meruva

%d means it prints only given value,
and %*d means it prints garbage value.
for eg: //it prints i value is=10
int i=10;
printf("i value is=%d",i);

//it prints garbage value
int i=10;
printf("i value is=%*d",i);

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the parts of c program?

635


What is the use of define in c?

597


What are loops in c?

551


What are the 3 types of structures?

572


What is function definition in c?

587






Describe wild pointers in c?

640


What are the advantages of using Unions?

642


What is the correct declaration of main?

679


What is the size of enum in c?

621


What is the value of h?

593


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1451


Where static variables are stored in memory in c?

523


The __________ attribute is used to announce variables based on definitions of columns in a table?

671


What are enums in c?

662


Explain what are global variables and explain how do you declare them?

642