#include<stdio.h>
#include<conio.h>
void main()
{
char a[30];
int i=2,a1=0;
clrscr();
printf("\n Enter comment:");
gets(a);
if(a[0]=='/')
{
if(a[1]=='/')
printf("\n It is a comment");
else if(a[1]=='*')
{
for(i=2;i<=30;i++)
{ if(a[i]=='*'&&a[i+1]=='/')
{
printf("\n It is a comment");
a1=1;
break;
}
else continue;
}
if(a1==0)
printf("\n It is not a comment");
}
else
printf("\n It is not a
comment");
}
else
printf("\n It is not a
comment");
getch();
}
Output :