This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int num; | |
printf("Enter an integer you want to check: "); | |
scanf("%d",&num); | |
if((num%2)==0) /* Checking whether remainder is 0 or not. */ | |
printf("%d is even.",num); | |
else | |
printf("%d is odd.",num); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int a, b, temp; | |
printf("Enter value of a: "); | |
scanf("%d",&a); | |
printf("Enter value of b: "); | |
scanf("%d",&b); | |
temp = a; /* Value of a is stored in variable temp */ | |
a = b; /* Value of b is stored in variable a */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int a; | |
float b; | |
double c; | |
char d; | |
printf("Size of int: %d bytes\n",sizeof(a)); | |
printf("Size of float: %d bytes\n",sizeof(b)); | |
printf("Size of double: %d bytes\n",sizeof(c)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* to find ASCII value of a character entered by user */ | |
#include <stdio.h> | |
int main() | |
{ | |
char c; | |
printf("Enter a character: "); | |
scanf("%c",&c); | |
printf("ASCII value of %c = %d\n",c,c); | |
return 0; |
NewerOlder