Posts

Showing posts with the label C PROGRAM

To convert hexadecimal to decimal numbers.

#include #include #include #include void main() {             char hex[' '], c;             int i,len,dec[' '],total;             clrscr();             do             {                         printf("Enter hexadecimal number:\t");                         gets(hex);                         len=strlen(hex);       ...

To convert hexadecimal to decimal numbers.

#include #include #include #include void main() {             char hex[' '], c;             int i,len,dec[' '],total;             clrscr();             do             {                         printf("Enter hexadecimal number:\t");                         gets(hex);                         len=strlen(hex);       ...

To display list of C program files and directories.

#include #include #include void main() {             clrscr();             printf("********** List of C Program files **********\n");             system("dir *.c /w");             printf("\n********** List of C Program directories **********\n");             system("dir /ad"); }

To convert hexadecimal to decimal numbers.

#include #include #include #include void main() {             char hex[' '], c;             int i,len,dec[' '],total;             clrscr();             do             {

To print whether the number entered is even or odd, using conditional operator

#include #include void main() {             int num;             char c;             clrscr();             do             {                         printf("Enter any number:\t");                         scanf("%d",&num);                         num%2==0 ? printf("\nNumber is even\n") : printf("\nNumber is odd\n");       ...