HELP!!!!

SO i'm trying to write this program for my class have no idea what to do. It's a currency converter. this I what I have so far but when I type a number my math is not being done can someone please help me thank you.

#include <stdio.h> //standard input/ouput library

int main( )
{
float Euro;
float Dollar;
Dollar = 1.00;
Euro = 0.93;
char c;
c = 1.00*0.93;
printf("Enter Amount to Convert:\n",'c');
scanf("%f,&Dollar");
Dollar = 'c';

printf("Euro amount is %f",Dollar);

}




All you need is the user's input of the amount of dollars. Then do the conversion (dollars*.93) and print out the answer.
something like?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int main()
{

	cout << fixed << setprecision(2);

	double Euros, input;
	cout << "Enter Amount to Convert: " << endl;
	cin >> input;
	Euros = input*.93;

	cout << "Euro amount is: " << Euros << endl;

	return 0;

}
#include <stdio.h> //standard input/ouput library

int main( )
{
float a;
float b,c;
a = 1.00;
b = 0.93;
c = a * b;

printf("Enter Amount to Convert:\n"); // input from user
scanf("%f,&c");
printf("Euro amount is %f",b);

}
where in here does it do the math at after I put a number in I get 0.93 no matter what number I put in .

Also joe864864 whats that cout and cin haven't learned any of that I have to use scanf and printf functions
cin and cout are C++. printf and scanf are C.
however, printf is much, much easier to format for simple programs, esp if dealing with floating point. I use both, depending on what I am doing.

b = 0.93.
you perhaps meant to write out b*c AFTER the scanf statement.
Your code reads in c, then writes out b, and there is no computation between...




Last edited on
Topic archived. No new replies allowed.