#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;
}
Why we take rs in floating point
ReplyDeleteBecause if you are having 1rupee 50paise .then 1.5 is the value you have take so flaot is required here
Deleteyes you are right , Thanks
Deleteyou can use integer also but float point that used for decimal also
ReplyDeleteYes you can use
DeleteGive an output
ReplyDelete10
ReplyDeleteif you input rs as 1.5 then your output will be paisa as 150
ReplyDelete