printf("The Resulting Integer Is: %d",&number1);
printf("\nThe Resulting Float Is: %f",&number2);
The problem is in these two lines of code. The function
printf
expects its arguments to be passed by value and you are passing their addresses. To correct this you can remove the ampersands so it looks like this :
printf("The Resulting Integer Is: %d\n", number1);
printf("The Resulting Float Is: %f\n", number2);
Note that I moved the new line character. I prefer to always follow a line of text with the new line character so that subsequent lines start at column zero. This is a habit I got into a long, long time ago.
One other note - I prefer to use the function
fgets[
^] to obtain input from a console. It includes the new line character in the string and has less quirky behavior than
scanf[
^]. Then one can call
atoi[
^] and
atof[
^] to get their respective numerical values. For your purposes, it does not matter that the new line character is included because the conversion functions ignore it.