Learn…. keep learning on……..

                              DAY 4

//Compare Operator

#include

#include

void main()

{

int a=5,b;

clrscr();

printf(”nEnter B value : “);

scanf(”%d”,&b);

printf(”nA Value Is = %d B Value Is = %d”,a,b);

if(a==b)

printf(”ntA And B Are Equal”);

else

printf(”ntA And B Are Not Equal”);

getch();

}

OUTPUT:-

/*   Modulus Operator

it  consider the remainder.*/

#include

#include

void main()

{

int a;

clrscr();

printf(”nEnter The No : “);

scanf(”%d”,&a);

if(a%2==0)

printf(”ntEven Number”);

else

printf(”ntOdd Number”);

getch();

}

OUTPUT:-

//Example For Not Operator

#include

#include

main()

{

int   a=100,b=30;

clrscr();

if(!(a<500))

printf(”b value  is %d “,b);

getch()

}

//Example For Or Operator

/* logic operator

&&–>and

||–>or

!–>not

Example For And Operator (&&)*/

#include

#include

//Unary Sizeof(1st Method)

#include

#include

void main()

{

clrscr();

printf(”n Bytes Of Int : %d”,sizeof(int));

printf(”n Bytes Of Character : %d” ,sizeof(char));

printf(”n Bytes Of Float: %d”,sizeof(float));

printf(”n Bytes Of Double : %d”,sizeof(double));

getch();

}

OUTPUT:-

//Unary Sizeof(2nd Method)

#include

#include

void main()

{

int a;

char  b[60];

float  c[5];

double d[3];

clrscr();

printf(”n Bytes Of Int : %d”,sizeof(a));

printf(”n Bytes Of Character : %d” ,sizeof(b));

printf(”n Bytes Of Float: %d”,sizeof(c));

printf(”n Bytes Of Double : %d”,sizeof(d));

getch();

}

OUTPUT:-

2
Liked it
Comments (0)

Currently there are no comments related to "Fourth Class". You have a special honor to be the first commenter. Thanks!

Leave a Comment

Hi there!

Hello! Welcome to Authspot, the spot for creative writing.
Read some stories and poems, and be sure to subscribe to our feed!

Find the Spot

Loading