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 produce the following output: 1 2 3 4 5 6 7 8 9 10
What is typedef struct in c?
What is C language Terminator?
program to print circle structure
Which of the following data structures is on average the fastest for retrieving data: 1) Binary Tree 2) Hash Table 3) Stack
Please write the area of a RIGHT ANGLED TRIANGLE.
What is a #include preprocessor?
What are the advantage of c language?
Program to find largest of three numbers without using comparsion operator?
Explain what is operator promotion?
what is disadvantage of pointer in C
What are the 3 types of structures?