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

void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }

1 Answers  


#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }

1 Answers  


struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error

3 Answers   HCL,


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.

5 Answers   IITR, Microsoft, Nike,






int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could anyone explain this to me.

2 Answers   Bosch, eInfochips, HCL, IHCL,


how can i cast a char type array to an int type array

2 Answers  


#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }

1 Answers  


find simple interest & compund interest

2 Answers  


how to test pierrot divisor

0 Answers  


main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }

2 Answers  


How do you write a program which produces its own source code as its output?

7 Answers  


Categories