0% found this document useful (0 votes)
8 views5 pages

Codings

The document contains multiple C programs that perform basic checks on user input. These programs determine if a number is positive, negative, or zero; check divisibility by 5 and 11; identify if a number is even or odd; verify if a year is a leap year; and classify a character as a vowel or consonant. Each program prompts the user for input and outputs the corresponding result based on the conditions specified.

Uploaded by

azaima000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Codings

The document contains multiple C programs that perform basic checks on user input. These programs determine if a number is positive, negative, or zero; check divisibility by 5 and 11; identify if a number is even or odd; verify if a year is a leap year; and classify a character as a vowel or consonant. Each program prompts the user for input and outputs the corresponding result based on the conditions specified.

Uploaded by

azaima000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

# ZERO, POSITIVE, NEGATIVE

#include<stdio.h>
int main ()
{ int num=0;
printf("Enter: ");
scanf("%d", &num);
if (num>0)
{
printf("POSITIVE");
}
else
if (num<0)
{
printf("NEGATIVE");
}
else
{
printf("ZERO");
}

return 0;
#DIVISBLE BY 5 AND 11 OR NOT

#include<stdio.h>
int main ()
{ int a;
printf("Enter:\n");
scanf("%d", &a);
if (a%5==0 && a%11==0)
{
printf("%d is divisible by 5 and 11", a);

}
else
{
printf("%d is NOT divisible by 5 and 11", a);

return 0;}
#EVEN OR ODD

#include<stdio.h>
int main ()
{ int a;
printf("Enter:\n");
scanf("%d", &a);
if (a%2==0)
{
printf("%d is EVEN", a);

}
else
{
printf("%d is ODD", a);

return 0;}
#LEAP YEAR

#include<stdio.h>
int main ()
{ int year;
printf("Enter the Year:\n");
scanf("%d", &year);
if (year%400==0)
{printf("%d is Leap Year", year);
}
else if (year%100==0)
{printf("%d is Not a Leap Year", year);
}
else if (year%4==0)
{ printf("%d is a Leap Year", year);
}
else
{printf("%d is Not a Leap Year", year);
}
return 0;}
#VOWEL OR CONSONENT

#include<stdio.h>

int main ()
{
char ch;
printf ("Enter Alphabet:\n");
scanf ("%c", &ch);

if (ch=='a' || ch=='e'|| ch=='i'|| ch=='o'||ch=='u'||


ch=='A' || ch=='E'|| ch=='I'|| ch=='O'||ch=='U')
{
printf ("%c is VOWEL\n", ch);
}
else
{
printf ("%c is CONSONENT\n", ch);
}
return 0;
}

You might also like