Jump to content

[SOLVED] C question


Recommended Posts

  • 4 weeks later...
  • 1 month later...

in the case of

 

scanf("%d", &units);

 

%d is saying to expect an integer.

 

others are %f for float, double and %c for char but there are more

 

 

in the case of

printf("%d Units", unit);

 

thats to say where you want the integer to be displayed

 

 

take your phone number for example

 

to print (XXX) XXX-XXXX, you can do that in one line of code:

printf("(%d) %d-%d", areaCode, exchange, phNum);

Link to comment
https://forums.phpfreaks.com/topic/87695-solved-c-question/#findComment-502634
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.