Preview:
#include <stdio.h>
#include <stdlib.h>

int main() {
    
    int number;
    int n;
    number=1;
    printf("enter the value of n");
    scanf("%d", &n);
    
    printf("even number from 1 to %d\n: ",n);
    while(number<=n)
    {
        if(number%2==0)
        printf("%d ",number);
        number++;
    }

    return 0;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter