Addition in C
Q. Write a C program for addition of two number.
#include
#include
int main(){
int a,b,c;
clrscr();
printf("Enter the numbers:");
scanf("%d %d",&a,&b);
c=a+b;
printf("Addition Of Two Number is: %d ",c);
getch();
return 0;
}
Q. Write an algorithm to addition of two number.
1. Start
2. Declare three integer variables: `a`, `b`, and `c`.
3. Display the message: "Enter the numbers:"
4. Read two integers from the user and store them in `a` and `b`.
5. Calculate the sum of `a` and `b` and store the result in `c`:
- `c = a + b`
6. Display the message: "Addition Of Two Number is: " followed by the value of `c`.
7. End
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.
point.com