Pages

Wednesday, August 17, 2016

Use of #define in C program.

Use of #define in C program.

#define p printf
#define s scanf
int main()
{
      float rs, paise;
      p("Enter Price:");
      s("%f", &rs);
           
      paise = rs * 100;
      p("Price in Paise = %.2f", paise);        
      return 0;
}


Output of the Program

Enter Price:5.5
Price in Paise = 550.00



No comments:

Post a Comment