Wednesday, October 21, 2020

c program to display if the given number is odd (2 different methods)

First Method:

#include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n%2!=0)

    {

        printf("Number=%d is odd",n);

    }

}


Second Method:

#include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n%2==1)

    {

        printf("Number=%d is odd",n);

    }

}

No comments:

Post a Comment

મારી જિંદગીના સૌથી મોટા પ્રેરણારૂપ: મમ્મીને જન્મદિવસની ખાસ શુભેચ્છાઓ 🎂✨

  https://www.youtube.com/watch?v=m4zfFxLUI7c હાય નમસ્તે જય શ્રી કૃષ્ણ સો ઓકે આ પહેલો મારો વિડીયો હશે જે હું ગુજરાતીમાં રેકોર્ડ કરવાની હતી ર...