From 8f798744aa6c9bf3c4c3ed56722b612c6df046e5 Mon Sep 17 00:00:00 2001 From: yash6969 <56515264+yash6969@users.noreply.github.com> Date: Sun, 13 Oct 2019 17:07:34 +0000 Subject: [PATCH 1/4] hii --- 5 Q2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 5 Q2.c diff --git a/5 Q2.c b/5 Q2.c new file mode 100644 index 0000000..3852d69 --- /dev/null +++ b/5 Q2.c @@ -0,0 +1,16 @@ +#include +int main() +{ + int p=1; + printf("enter a no. \n"); + scanf("%d",&a); + + while(p<=a) + { + a=a*p; + + p++; + } + printf("%d",a); + return 0; +} From 5ce53513a9b39b69390ad74817e7f46157ed086f Mon Sep 17 00:00:00 2001 From: yash6969 <56515264+yash6969@users.noreply.github.com> Date: Sun, 13 Oct 2019 17:08:51 +0000 Subject: [PATCH 2/4] helllo --- 5Q3.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 5Q3.c diff --git a/5Q3.c b/5Q3.c new file mode 100644 index 0000000..28907e3 --- /dev/null +++ b/5Q3.c @@ -0,0 +1,18 @@ +#include +int main() +{ + int i=1,a,b; + long int k; + printf("enter 2 integers"); + scanf("%d,%d",&a,&b); + while(i<=b) + { + k=k*i; + printf("%d",k); + i++; + } + + return 0; + + +} From e4d552f44cfb2e5b2b1313b5322502291408a682 Mon Sep 17 00:00:00 2001 From: yash6969 <56515264+yash6969@users.noreply.github.com> Date: Sun, 13 Oct 2019 17:14:35 +0000 Subject: [PATCH 3/4] hello From e523e8ea152d4c952f66c6357db7d77de0bcf395 Mon Sep 17 00:00:00 2001 From: yash6969 <56515264+yash6969@users.noreply.github.com> Date: Sun, 13 Oct 2019 17:15:39 +0000 Subject: [PATCH 4/4] hii dp --- dp 2.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dp 2.c diff --git a/dp 2.c b/dp 2.c new file mode 100644 index 0000000..baac0a2 --- /dev/null +++ b/dp 2.c @@ -0,0 +1,26 @@ +#include +int main() +{ +int pos,neg,zero,a; +char ans='y'; +pos=0; +neg=0; +zero=0; +while(ans=='y') +{ + printf("enter the number\n"); + scanf("%d",&a); +if(a==0) +zero++; +if(a<0) +neg++; +if(a>0) + pos++; +printf("do you want to continue\n"); +scanf("%c",&ans); +} +printf("positivenumber%d",pos); +printf("negative %d",neg); +printf("zero%d",zero); +return 0; +}