Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

Post New Answer

More C Interview Questions

Array is an lvalue or not?

0 Answers  


question-how to run a c programme.

6 Answers  


Explain what are run-time errors?

0 Answers  


wite a programme in c to linear search a data using flag and without using flags?

3 Answers   TCS,


write a program to find the largest and second largest integer from an array

2 Answers   Value Labs,


how can u print a message without using any library function in c

1 Answers   NIIT,


What is extern variable in c with example?

0 Answers  


Hierarchy decides which operator a) is most important b) is used first c) is fastest d) operates on largest numbers

1 Answers  


#define swap1(a,b) a=a+b;b=a-b;a=a-b; main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); } int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; } what are the outputs?

4 Answers   Ramco,


2.Given the short c program that follows a. make a list of the memory variables in this program b.which lines of code contain operations that change the contents of memory? what are those operations? Void main( void) { Double base; Double height; Double area; Printf(“enter base and height of triangle :”); Scanf(“%lg”, &base); Scanf(“%lg”, &height); Area=base*height/2.0; Printf(“the area of the triangle is %g \n”,area); }

1 Answers   Wipro,


how to find your architecture is LittleEndian or BigEndian?

1 Answers  


Why cann't whole array can be passed to function as value.

1 Answers  


Categories