Write a C program to verify the string 0(0|1)*0 | 1(0|1)*0
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char str[20];
int i,len;
clrscr();
printf("\n Enter the
String:-");
gets(str);
len=strlen(str)-1;
if((str[0]=='0' &&
str[len]=='0')) printf("\n Validddd.....");
else if(str[0]=='1' &&
str[len]=='0')
printf("\n
Validddd.....");
else
printf("\n INValid
String");
getch();}