can u give me the c codings for converting a string into
the hexa decimal form......



can u give me the c codings for converting a string into the hexa decimal form........

Answer / ravi jaiswal

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char x[25];
int i=0;
printf("Enter a string");
gets(x);
while(x[i]!='\0')
{
printf("%x\t",x[i]);
i++;
}
getch();
}

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Code Interview Questions

Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000

3 Answers   HCL,


void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 Answers  


main() { char a[4]="HELLO"; printf("%s",a); }

3 Answers   CSC,


# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }

1 Answers  






Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }

1 Answers  


There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.

1 Answers   TCS,


How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...

6 Answers   Microsoft, MSD, Oracle,


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

9 Answers   Microsoft,


what is oop?

3 Answers  


Categories