C Program for the addition of two numbers
Sure, here's a simple C program to add two numbers:
```c
#include
int main() {
double num1, num2, sum;
printf("Enter first number: ");
scanf("%lf", &num1);
printf("Enter second number: ");
scanf("%lf", &num2);
sum = num1 + num2;
printf("Sum = %.2lf\n", sum);
return 0;
}
```
This program prompts the user to enter two numbers, then adds them and displays the result.
Comments
Post a Comment