From e87428cb2230f7ca052f48b34fd8833046ecd8b0 Mon Sep 17 00:00:00 2001 From: chenlin1595-cpu Date: Wed, 8 Oct 2025 18:16:30 -0600 Subject: [PATCH 1/6] Update ARRAY.c Fixed some spelling --- ARRAY.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ARRAY.c b/ARRAY.c index c8c7734..0d59319 100644 --- a/ARRAY.c +++ b/ARRAY.c @@ -49,7 +49,7 @@ void deletion(){ } void updation(){ - printf("ENTER THE POSITION WHERE U WANT TO UPDATE"); + printf("ENTER THE POSITION WHERE YOU WANT TO UPDATE"); scanf("%d",&position); if(position>n){ printf("\n INVALID POSITION\n"); @@ -72,7 +72,7 @@ void linear_search(){ } } if(choice!=20){ - printf("\nELEMNT NOT FOUND!!!"); + printf("\nELEMENT NOT FOUND!!!"); } menu(); } @@ -197,3 +197,4 @@ int main(){ return 0; } + From e14e693144da451cde53bb79122a757767c58d5d Mon Sep 17 00:00:00 2001 From: chenlin1595-cpu Date: Wed, 8 Oct 2025 18:35:34 -0600 Subject: [PATCH 2/6] Update Area_of_Circle.c added formula so that it can calculate circumference --- Area_of_Circle.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Area_of_Circle.c b/Area_of_Circle.c index d38ffef..7d68637 100755 --- a/Area_of_Circle.c +++ b/Area_of_Circle.c @@ -1,8 +1,13 @@ #include -void main() -{ float a,r; +#define PI 3.14 +int main() +{ float area, r, circumference; printf("Enter the Radius : "); scanf("%f",&r); -a=3.14*r*r; -printf("Area is %f",a); +area=PI*r*r; +circumference=2*PI*r; +printf("Area is %f",area); +printf("Circumference is %f", circumference); +return 0; } + From 0a8a2ef17cdfb63a230d87054c6bfbd1c794cbce Mon Sep 17 00:00:00 2001 From: chenlin1595-cpu Date: Wed, 8 Oct 2025 18:40:15 -0600 Subject: [PATCH 3/6] Update Area_of_Square.c added formula for perimeter of a square --- Area_of_Square.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Area_of_Square.c b/Area_of_Square.c index e1afd7d..6c27cd9 100755 --- a/Area_of_Square.c +++ b/Area_of_Square.c @@ -1,8 +1,11 @@ #include -void main() -{ float a,r; -printf("Enter the Radius : "); -scanf("%f",&s); -a=s*s; -printf("Area is %f",a); +int main() +{ float area,side,perimeter; +printf("Enter the length of side: "); +scanf("%f",&side); +area=side*side; +perimeter=4*side; +printf("Area is %f",area); +printf("Perimeter is %f", perimeter); +return 0; } From ad6aff79debd324d90fa92e231773209eccd690e Mon Sep 17 00:00:00 2001 From: chenlin1595-cpu Date: Wed, 8 Oct 2025 18:41:55 -0600 Subject: [PATCH 4/6] Update Area_of_Triangle.c made variable names clearer --- Area_of_Triangle.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Area_of_Triangle.c b/Area_of_Triangle.c index 8700ba5..7af85b9 100755 --- a/Area_of_Triangle.c +++ b/Area_of_Triangle.c @@ -1,10 +1,10 @@ #include void main() -{ float a,b,h; +{ float area,base,height; printf("Enter the base : "); -scanf("%f",&b); +scanf("%f",&base); printf("Enter the height : "); -scanf("%f",&h); -a=0.5*b*h; -printf("Area is %f",a); +scanf("%f",&height); +area=0.5*base*height; +printf("Area is %f",area); } From fc6515e25cb4c3cee033c547d08c9741e18e2ecb Mon Sep 17 00:00:00 2001 From: chenlin1595-cpu Date: Wed, 8 Oct 2025 18:48:55 -0600 Subject: [PATCH 5/6] Update AreaAndCircumference.c clarified variable names --- AreaAndCircumference.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/AreaAndCircumference.c b/AreaAndCircumference.c index 5e6f005..cc1d8e1 100644 --- a/AreaAndCircumference.c +++ b/AreaAndCircumference.c @@ -3,11 +3,12 @@ #include int main() { - float r, a ,c; + float radius, area ,circumference; printf("enter radius :\n"); - scanf("%f", &r); - a = 3.14*r*r; - c = 2*3.14*r; - printf("Area = %f\n circumference = %f\n",a,c); + scanf("%f", &radius); + area = 3.14*radius*radius; + circumference = 2*3.14*radius; + printf("Area = %f\n circumference = %f\n",area,circumference); return 0; } + From af0a413183db10f3515ed31309cc260fb0c37ec3 Mon Sep 17 00:00:00 2001 From: chenlin1595-cpu Date: Wed, 8 Oct 2025 18:53:30 -0600 Subject: [PATCH 6/6] Update Addition.c added the difference between a and b, clarified variable names --- Addition.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Addition.c b/Addition.c index 06f23b8..55f2f72 100755 --- a/Addition.c +++ b/Addition.c @@ -1,8 +1,11 @@ #include -void main() -{ int a,b,c; +int main() +{ int a,b,sum,difference; printf("Enter two Numbers : "); scanf("%d %d",&a,&b); -c=a+b; -printf("The Sum is %d",c); +sum=a+b; +difference=a-b; +printf("The Sum is %d",sum); +printf("The Difference is %d",difference); +return 0; }