Quick Posts

Post Page Advertisement [Top]

As i explained whole process of installing and using turbo c++ for a newbie. If you missed that click Here.
Let's be straight. Here is the script for creating a program that can convert price in dollars to price in rupees (Pakistani).

Script:

#include<conio.h>
#include<stdio.h>
void main()
{
float dollar,pkr,rate;
clrscr();
printf("Enter price of one dollar in Pakistani rupees:");
scanf("%f",&rate);
printf("Enter amount to convert into rupees:");
scanf("%f",&dollar);
pkr=dollar*rate;
printf("%f in Pakistani rupees = %f",dollar,pkr);
getch();
}



That's all. You can use other currency to be converted instead of dollar by giving other value when it asks for price of other currency. Remeber this script will work with Turboo C++. It can also work on other compilers too but Given is best and also very easy with user-friendly interface.

No comments:

Bottom Ad [Post Page]

| Designed by Colorlib