Find the maximum consecutive 1's in a string of 0's and 1's.
#include<stdio.h>
#include<string.h>
void main()
{
printf("Enter the string of '0's and '1's ");
char str[100];
int count1=0;
scanf("%s", str);
for(int i=0;i<strlen(str);i++)
{
if(str[i] == '1')
{
count1++;
}
}
printf("Max number of consecutive 1's is %d",count1);
}