#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
Just as you would do it manually, I mean there is no predefined 'solve_equation' function in C.
Computer Concepts & Programming
If y = a + bi and z = c + di are two complex numbers then z - y = (c - a) + (d - b)i
sum = a + b + c;
C is a low level programming language or it is also called as machine level language as the code written in C is encrypted into machine readable form then it is executed. If you want to learn C programming language in depth then Newtum is a best option to start with. It's C programming online course provides complete knowledge of the all the basic concepts involved in programming. If you are interested, please vivist our website!
int main() { int x = 40 + 2; }
Object oriented programming and structured programming.
There are two programming languages which use a C switch statement. The two languages are C and C++, hence the name C switch statement. There may be more, but those are the most obvious ones
c is programming laungage
C++, Perl, Fortran
loops execute a set of insructions repeatedly for a certain numbers of times..
The memcpy library is used in computer programming to copy the value of numbers from a source to the memory block destination. Memcpy is frequently used in the C++ programming language.
C and C++ are both high-level programming languages.
create spiral in c programming?
Your question makes no sense, you cannot "reinstall" programming languages (or vitamines, or letters, or Roman numbers)
Robert Lafore has written: 'Object-oriented programming in Microsoft C++' -- subject(s): Object-oriented programming (Computer science), C++ (Computer program language), C. 'Microsoft C. Programming for the I.B.M.Personal Computer' 'Object-oriented programming in C++' 'Windows Programming Made Ridiculously Easy Book' 'The Waite Group's C Programming Using Turbo C++ (The Waite Group)' 'Microsoft C programming for the IBM' 'The Waite Group's Microsoft C programming for the PC' -- subject(s): C (Computer program language), IBM microcomputers, Microsoft C (Computer program), Microsoft C., Programming
C - programming language - was created in 1972.