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 |
Explain how do you view the path?
What are .h files and what should I put in them?
What is structure and union in c?
what does ‘segmentation violation’ mean?
Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
what is use of loop?
What is bubble sort technique in c?
write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4
write the program to find multiplication of 2-D matrix??????????
Why we use break in c?
What are the phases in s/w developed life cycle? wat is the diff b/w stack & queue...where do we use stack
how to find out the reverse number of a digit if it is input through the keyboard?