Make a program that asks for two numbers to the user and print the largest. ( in C)
Make a program that asks for two numbers to the user and print the largest. ( in C)
What have you tried? Post your attempt (in code tags) and tell us specifically where you're having trouble.
#include <stdio.h>
Main() {
Int X;
Y;
Printf("write the two numbers:");
Scanf("%d %d",&x,&y);
Sorry if have something wrong, i'm beginner. At thus point i don't now how to indicate the largest number!
Maybe you should start with a simpler program, such as "hello world". Here is a version of it:
Get an IDE such as CodeBlocks, compile and run the above example and see what it does. Try to change bits of it and observe the differences in execution or the errors. Also, take note of the indentation, clear code is essential.Code:#include <stdio.h> int main(void) { printf("Hello World!\n"); getchar(); return 0; }
Devoted my life to programming...
Please post code in code tags (as I linked above, see the red text), and be sure the basic syntax is correct (hint: C is case sensitive). You should add a line to print the two numbers you read, and ensure the code compiles and runs as expected, before moving on to the next step.
Have you learned how to have your code make a decision yet?
I started learning the language c the short time n have much practice yet, but thanks for the tips.