0% found this document useful (0 votes)
7 views

Prog

The document contains multiple C code programs that use if/else conditional statements to check various conditions and print corresponding output messages. Each program tests for a different condition: divisibility of a number, comparison of values, validity of a number within a range, eligibility based on age/marks/height, and assigning a letter grade based on marks percentage.

Uploaded by

reg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Prog

The document contains multiple C code programs that use if/else conditional statements to check various conditions and print corresponding output messages. Each program tests for a different condition: divisibility of a number, comparison of values, validity of a number within a range, eligibility based on age/marks/height, and assigning a letter grade based on marks percentage.

Uploaded by

reg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

#include<stdio.

h>

#include<conio.h>

int main()

int number;

printf("enter the number=");

scanf("%d",&number);

if(number%7==0);

printf("number is divisible by 7 \n");

if(number%7!=0)

printf("number is some other");

getchar();

return 0;

#include<stdio.h>

#include<conio.h>

int main()

int x,y,z;

printf("enter the x=");

scanf("%d",&x);

printf("enter the y=");

scanf("%d",&y);

x%y==z;

if(z==0);

printf("z is completely divisible \n");

if(z!=0)
printf("z is not completely divisible \n");

getchar();

return 0;

#include<stdio.h>

#include<conio.h>

int main()

int x,y,z;

printf("enter the x=");

scanf("%d",&x);

printf("enter the y=");

scanf("%d",&y);

printf("enter the z=");

scanf("%d",&z);

if(x>y&&x>z)

printf("x is the grater value");

if(y>x&&y>z)

printf("y is the greater value");

if(z>x&&z>y)

printf("z is the greater value");

getchar();

return 0;

}
#include<stdio.h>

#include<conio.h>

int main()

int number;

printf("ENTER YOUR NUMBER=");

scanf("%d",&number);

if(0<number<=10)

printf("number is valid");

else

printf("NUMBER IS INVALID");

getchar();

return 0;

#include<stdio.h>

#include<conio.h>

int main()

int number;

printf("ENTER YOUR NUMBER=");

scanf("%d",&number);
if(0<number && number<=10)

printf("number is valid");

else

printf("NUMBER IS INVALID");

getchar();

return 0;

#include<stdio.h>

#include<conio.h>

int main()

int age, marks;

float height;

printf("enter the marks=");

scanf("%d",&marks);

printf("enter the age=");

scanf("%d",&age);

printf("enter the height=");

scanf("%f",&height);

if(age>16 &&age<20 && marks>60 && height>5.6)

printf("congratulations you are selected \n");

if(age<16 || age>20)

printf("sorry you are under age \n ");

if(marks<60)

printf("sorry your marks are less \n ");

if(height<5.6)
printf("sorry your under height \n ");

getchar();

return 0;

#include<stdio.h>

#include<conio.h>

int main()

int marks;

printf("enter the marks=");

scanf("%d",&marks);

if(marks>51 && marks<60 )

printf("your grade is D \n");

if(marks<70 && marks>60)

printf("your grade is c \n ");

if(marks>70 && marks<80)

printf("your grade is B \n ");

if(marks>80&&marks<90)

printf("your grade is A \n ");

getchar();

return 0;

You might also like