Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

bracket

#include <stdio.h>

void main()
{
    char a[4];
    int flag=0;
    // printf("enter the symbol of ( and ) ");
    for(int i=0;i<4;i++)
    {
      scanf("%c",&a[i]);
    }  
    for(int j=0;j<2;j++)
    {
        if(a[j]==a[4-j-1])
        {
            flag++;
        }
        else
        {
            flag=0;
            break;
        }
    }
    printf("%d",flag);
    if(flag!=0)
    {
        printf("correct");
    }
    else
      printf("incorrect");
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.