EVEN LENGTH SUBSTRING- EQUAL SUM HALVES(ZOHO)
PROGRAM
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
char a[100],b[100],c[100];
scanf("%s",a);
int i,j,k,l,y,n,flag=0;
for(i=0;i<strlen(a);i++)
{
for(j=0;j<=i;j++)
{
l=0,y=0,n=0;
if((i-j)%2==1)
{
for(k=j;k<=i;k++)
{
b[l]=a[k];
l++;
}
b[l]='\0';
for(k=0;k<(strlen(b)/2);k++)
{
y=y+(b[k]-48);
n=n+(b[strlen(b)-k-1]-48);
}
if(y==n && strlen(b)>strlen(c))
{
strcpy(c,b);
flag=1;
}
}
}
}
if(flag==1)
printf("%s",c);
else
printf("-1");
}
0diotheAcont_se_1997 Ivan Hindiyeh https://wakelet.com/@pensrundpasbott926
ReplyDeleteoregtrohec
WcalcuVper-n Katrina Chambers Here
ReplyDeletecontnajare
Zoho offers a powerful suite of cloud-based applications designed to help businesses of all sizes manage operations more efficiently. From CRM and accounting to HR, marketing, and project management, Zoho’s integrated tools streamline workflows and improve collaboration. Partnering with an experienced Zoho CRM implementation partner USA ensures you choose the right apps, customize them to your needs, and get the most value from your investment—driving productivity and growth.
ReplyDelete