if else

 #include <stdio.h>

int main()
{
    int age;
    printf("enter u r age:");
    scanf("%d",&age);
    printf("u r age is %d\n",age);
    if(age>=18)
    {
       printf("u can vote");
    }
    else if (age<=10)
    {
        printf("u can vote for kids");
    }
   
    else
    {
        printf("sorry u cannot vote");
    }
   
    return 0;
}

Comments

Popular posts from this blog

Tokens in C

Steps taken by a compiler to execute a C program

Variables and Data Types in C