Saturday, 22 August 2015

Write a C Program to Convert Rupess into Paisa

#include<stdio.h>
#include<conio.h>

int main()
{
             float rs;  //real variable for rupees
             int ps;    // integer variable for paisa
             clrscr();

             printf("\n\n Enter rupees to convert into paisa : ");
             scanf("%f",&rs);

             ps=rs*100;

             printf("\n Paisa of given rupees is %d",ps);

             getch();

            return 0;

}

8 comments:

  1. Why we take rs in floating point

    ReplyDelete
    Replies
    1. Because if you are having 1rupee 50paise .then 1.5 is the value you have take so flaot is required here

      Delete
    2. yes you are right , Thanks

      Delete
  2. you can use integer also but float point that used for decimal also

    ReplyDelete
  3. if you input rs as 1.5 then your output will be paisa as 150

    ReplyDelete