Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hehehe #11

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions add.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
#include <stdio.h>

int main() {
int num1, num2, sum;

printf("Enter the first number: ");
scanf("%d", &num1);

printf("Enter the second number: ");
scanf("%d", &num2);

sum = num1 + num2;

printf("The sum of %d and %d is %d.", num1, num2, sum);

return 0;
void main()
{
int number1, number2, sum;
printf("Enter two integers: ");
scanf("%d %d", &number1, &number2);
sum = number1 + number2;
printf("%d + %d = %d", number2, number4, sum);
}
13 changes: 13 additions & 0 deletions mul.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>
void main()
{
double a, b, product;
printf("Enter two numbers: ");
scanf("%lf %lf", &a, &b);

// Calculating product
product = a * b;

// %.2lf displays number up to 2 decimal point
printf("Product = %.2lf", product);
}
10 changes: 10 additions & 0 deletions multiply.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdio.h>
int main() {
int n;
printf("Enter an integer: ");
scanf("%d", &n);
for (int i = 1; i <= 10; ++i) {
printf("%d * %d = %d \n", n, i, n * i);
}
return 0;
}