What is the difference between %d and %*d in C
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / ram
%d prints the given value,
%*d... used to print the mentioned length of given value
| Is This Answer Correct ? | 0 Yes | 5 No |
write a program to check whether a number is Peterson or not.
What are multidimensional arrays?
What are pointers? What are stacks and queues?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
what is stack , heap ,code segment,and data segment
Why does notstrcat(string, "!");Work?
what is the importance of spanning tree?
write a program without using main function?
What is the meaning of c in c language?
Why c is called a mid level programming language?
How can I increase the allowable number of simultaneously open files?
Why c is called object oriented language?