diff --git a/17EGICS071_ASS6_2.C b/17EGICS071_ASS6_2.C new file mode 100644 index 0000000..c421584 --- /dev/null +++ b/17EGICS071_ASS6_2.C @@ -0,0 +1,38 @@ +#include +#include +int c =0; +int count_pair(int a, int b , int k) +{ + if(k==(a+b)) + { c++; + return c; + } + else{ + return 0; + } +} +int main() +{ + int n,t, i,j,result , count; + printf("Enter the size of an aaray"); + scanf("%d",&n); + int a[n]; + printf("Enter the elments"); + for(i=0;i0) + { i++; + count=result; + } +} + } + printf("Count :%d",count); + getch(); + return 0; +} diff --git a/17EGICS071_Araay11.c.c b/17EGICS071_Araay11.c.c new file mode 100644 index 0000000..f1e43df --- /dev/null +++ b/17EGICS071_Araay11.c.c @@ -0,0 +1,34 @@ +#include +#include +#include +int main() +{ int n,sum1=0,sum2=0,i,t; + printf("Enter size of an array"); + scanf("%d",&n); + int a[n]; + printf("Enter elements of an array"); + for(i=0;isum1) + { + sum1=sum2; + printf("%d ",a[i]); + } + if(sum2<0){ + sum2=0; + sum1=0; + } + }} + printf("\nLargest sum : %d",sum1); +getch(); + return 0; +}