Skip to content
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
16 changes: 16 additions & 0 deletions Task 2/IIB2025033/star.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <stdio.h>
int main() {
int n,i,j;
printf("Enter the no. of rows: ");
scanf("%d",&n);
for (i=1;i<=n;i++) {
for (j=1;j<=n-1;j++) {
printf(" ");
}
for (j=1;j<=2*i-1;j++) {
printf("*");
}
printf("\n");
}
return 0;
}
1 change: 1 addition & 0 deletions Task 3/IIB2025033/calculator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Calculator is a device used to perform arithmatic operations on two or more numbers.
33 changes: 33 additions & 0 deletions Task 3/IIB2025033/calculator_code.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <stdio.h>
int main() {
int n1,n2,op;
printf("Enter the first no.: ");
scanf("%d",&n1);
printf("Enter the second no.: ");
scanf("%d",&n2);
printf ("Enter the operation to be done (1 for +, 2 for -, 3 for *, 4 for /");
scanf("%d",&op);
if (op==1) {
printf("The sum of %d and %d is %d",n1,n2,n1+n2);
}
else if (op==2) {
if (n1>n2) {
printf("The difference between %d and %d is %d",n1,n2,n1-n2);
}
else {
printf("The difference between %d and %d is %d",n2,n1,n2-n1);
}
}
else if (op==3) {
printf("The product between %d and %d is %d",n1,n2,n1*n2);
}
else {
if (n2==0) {
printf("Invalid divison with 0");
}
else {
printf("The quotient of %d upon dividing with %d is %d",n1,n2,n1/n2);
}
}
return 0;
}