Sunday, November 1, 2020

C program of even numbers in between 1-10

First Method:

#include <stdio.h>

int main()

{

    int i;

    for(i=2;i<=10;i+=2)

    {

        printf("%d",i);

    }

    return 0;

}


Second Method:
#include <stdio.h>
int main()
{
    int i,n;
    printf("Enter a number:");
    scanf("%d",&n);
    for(i=2;i<=n;i+=2)
    {
        printf("%d",i);
    }
    return 0;
}

No comments:

Post a Comment

The Power of a Genuine Compliment: A Small Kindness That Can Change Your Day 😊

  https://www.youtube.com/watch?v=i1gDGLY4kC8 Hi, namaste. Kamcho. So, uh I was just thinking like I was working now. It's almost going ...