math.answers.com/math-and-arithmetic/C_programming_for_adding_two_numbers

Preview meta tags from the math.answers.com website.

Linked Hostnames

8

Thumbnail

Search Engine Appearance

Google

https://math.answers.com/math-and-arithmetic/C_programming_for_adding_two_numbers

C programming for adding two numbers? - Answers

#include <stdio.h> #include <conio.h> int main() { int x; int y; int result; printf("Enter the first number to be added: "); scanf("%d",&x); printf("Enter the second number to be added: "); scanf("%d",&y); result = x + y; printf("Here is the result %d\n",result); return(0); getch(); } Heres the low down: 1) The #include <stdio.h> includes the file stdio.h into your code so it knows what the functions such as printf() mean. 2) int main() is the main function you write most of your code in. 3) int x; , int y; , and int result. the int stands for integer or a number (no decimal points you need a float for that) the X and Y are the numbers you are adding together and result is the result of the numbers. 4) printf("Enter the first number to be added: "); scanf("%d",&x); the Printf() prints the text, Enter the first number to be added: , onto the screen and the scanf("%d",&x); looks for the number input from the keyboard for x. 5) printf("Enter the second number to be added: "); scanf("%d",&y); does pretty much the same as the last 2 lines except it looks for the value for y instead of x. 6) result = x + y; that adds the values of X and Y and stores the result in the variable result. 7) printf("Here is the result %d\n",result); return(0); that prints the result on the screen and the return(0); tells the OS that the program ended successfully. Hope this helps, Mr. Man



Bing

C programming for adding two numbers? - Answers

https://math.answers.com/math-and-arithmetic/C_programming_for_adding_two_numbers

#include <stdio.h> #include <conio.h> int main() { int x; int y; int result; printf("Enter the first number to be added: "); scanf("%d",&x); printf("Enter the second number to be added: "); scanf("%d",&y); result = x + y; printf("Here is the result %d\n",result); return(0); getch(); } Heres the low down: 1) The #include <stdio.h> includes the file stdio.h into your code so it knows what the functions such as printf() mean. 2) int main() is the main function you write most of your code in. 3) int x; , int y; , and int result. the int stands for integer or a number (no decimal points you need a float for that) the X and Y are the numbers you are adding together and result is the result of the numbers. 4) printf("Enter the first number to be added: "); scanf("%d",&x); the Printf() prints the text, Enter the first number to be added: , onto the screen and the scanf("%d",&x); looks for the number input from the keyboard for x. 5) printf("Enter the second number to be added: "); scanf("%d",&y); does pretty much the same as the last 2 lines except it looks for the value for y instead of x. 6) result = x + y; that adds the values of X and Y and stores the result in the variable result. 7) printf("Here is the result %d\n",result); return(0); that prints the result on the screen and the return(0); tells the OS that the program ended successfully. Hope this helps, Mr. Man



DuckDuckGo

https://math.answers.com/math-and-arithmetic/C_programming_for_adding_two_numbers

C programming for adding two numbers? - Answers

#include <stdio.h> #include <conio.h> int main() { int x; int y; int result; printf("Enter the first number to be added: "); scanf("%d",&x); printf("Enter the second number to be added: "); scanf("%d",&y); result = x + y; printf("Here is the result %d\n",result); return(0); getch(); } Heres the low down: 1) The #include <stdio.h> includes the file stdio.h into your code so it knows what the functions such as printf() mean. 2) int main() is the main function you write most of your code in. 3) int x; , int y; , and int result. the int stands for integer or a number (no decimal points you need a float for that) the X and Y are the numbers you are adding together and result is the result of the numbers. 4) printf("Enter the first number to be added: "); scanf("%d",&x); the Printf() prints the text, Enter the first number to be added: , onto the screen and the scanf("%d",&x); looks for the number input from the keyboard for x. 5) printf("Enter the second number to be added: "); scanf("%d",&y); does pretty much the same as the last 2 lines except it looks for the value for y instead of x. 6) result = x + y; that adds the values of X and Y and stores the result in the variable result. 7) printf("Here is the result %d\n",result); return(0); that prints the result on the screen and the return(0); tells the OS that the program ended successfully. Hope this helps, Mr. Man

  • General Meta Tags

    22
    • title
      C programming for adding two numbers? - Answers
    • charset
      utf-8
    • Content-Type
      text/html; charset=utf-8
    • viewport
      minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no
    • X-UA-Compatible
      IE=edge,chrome=1
  • Open Graph Meta Tags

    7
    • og:image
      https://st.answers.com/html_test_assets/Answers_Blue.jpeg
    • og:image:width
      900
    • og:image:height
      900
    • og:site_name
      Answers
    • og:description
      #include <stdio.h> #include <conio.h> int main() { int x; int y; int result; printf("Enter the first number to be added: "); scanf("%d",&x); printf("Enter the second number to be added: "); scanf("%d",&y); result = x + y; printf("Here is the result %d\n",result); return(0); getch(); } Heres the low down: 1) The #include <stdio.h> includes the file stdio.h into your code so it knows what the functions such as printf() mean. 2) int main() is the main function you write most of your code in. 3) int x; , int y; , and int result. the int stands for integer or a number (no decimal points you need a float for that) the X and Y are the numbers you are adding together and result is the result of the numbers. 4) printf("Enter the first number to be added: "); scanf("%d",&x); the Printf() prints the text, Enter the first number to be added: , onto the screen and the scanf("%d",&x); looks for the number input from the keyboard for x. 5) printf("Enter the second number to be added: "); scanf("%d",&y); does pretty much the same as the last 2 lines except it looks for the value for y instead of x. 6) result = x + y; that adds the values of X and Y and stores the result in the variable result. 7) printf("Here is the result %d\n",result); return(0); that prints the result on the screen and the return(0); tells the OS that the program ended successfully. Hope this helps, Mr. Man
  • Twitter Meta Tags

    1
    • twitter:card
      summary_large_image
  • Link Tags

    16
    • alternate
      https://www.answers.com/feed.rss
    • apple-touch-icon
      /icons/180x180.png
    • canonical
      https://math.answers.com/math-and-arithmetic/C_programming_for_adding_two_numbers
    • icon
      /favicon.svg
    • icon
      /icons/16x16.png

Links

58