EVEN NUMBER

Q. Write a C Program to check whether the given number is Even or Not.

#include<stdio.h>
main()
{
    int num;
    scanf("%d",&num);
    if(num%2==0)
    printf("Even Number");
    else
    printf("ODD Number");
    }


Q. Write a C Program to Print first 10 Even Number starting from 1. Use For Loop, If-Else and Break;

#include<stdio.h>
main()
{
        int i,cnt=0;
        for(i=1; ;i++)
        {
            if (i%2==0)
                {
                cnt=cnt+1;
                if (cnt<=10)
                    printf("%d ",i);
                else
                    break;
                }
        }
}