From 6a2dff9cf3099edfcd5706c7573dd0d63d2c3dae Mon Sep 17 00:00:00 2001 From: njain794 <44344547+njain794@users.noreply.github.com> Date: Fri, 26 Oct 2018 21:20:09 +0530 Subject: [PATCH 1/3] Update Basic_1.c code in c language - whether a no. is even or odd --- Basic_1.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Basic_1.c b/Basic_1.c index 5f89310..72aabe1 100644 --- a/Basic_1.c +++ b/Basic_1.c @@ -1,3 +1,21 @@ // TASK // Write code to find if the number is even or odd // Code Below +#include +#include +void main() +{ + clrscr(); + int a,b,c; + printf("enter the no. to find out whether it is even or odd"); + scanf("%d",&a); + if(a%2==0) + { + printf("no. is even"); + } + else + { + printf("no. is odd"0); + } + getch(); +} From e7b2cd1cbd54f7e2006df861f8842c1396e0907a Mon Sep 17 00:00:00 2001 From: njain794 <44344547+njain794@users.noreply.github.com> Date: Fri, 26 Oct 2018 21:25:26 +0530 Subject: [PATCH 2/3] Update Basic_12.c code to find cube of a no. in c languge --- Basic_12.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Basic_12.c b/Basic_12.c index 81bcbae..4227168 100644 --- a/Basic_12.c +++ b/Basic_12.c @@ -1,3 +1,15 @@ // TASK // Write code to find cube of a number // Code Below +#include +#include +void main() +{ + clrscr(); + int a,b=0,c; + printf("enter the no to take out its cube = "); + scanf("%d",&a); + b=a*a*a; + printf("cube of no. is = %d",b); + getch(); +} From 71eee57a84dff94c271978e6bb6297cae240faa7 Mon Sep 17 00:00:00 2001 From: njain794 <44344547+njain794@users.noreply.github.com> Date: Fri, 26 Oct 2018 21:40:43 +0530 Subject: [PATCH 3/3] Update Basic_2.c code to check whether a no. is positive or negative in c language --- Basic_2.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Basic_2.c b/Basic_2.c index 1b8ccc2..4cb8c82 100644 --- a/Basic_2.c +++ b/Basic_2.c @@ -1,3 +1,21 @@ // TASK // Write code to find if the number is positive or negative // Code Below +#include +#include +void main() +{ + clrscr(); + int a,b,c; + printf("enter the no. to check whether it is positive or not = "); + scanf("%d",&a); + if(a>=0) + { + printf("no. is positive"); + } + else + { + printf("no. is negative"); + } + getch(); +}