how to convert decimal to hexadecimal without using arrays
just loops

Answers were Sorted based on User's Feedback



how to convert decimal to hexadecimal without using arrays just loops..

Answer / dhatchina moorthy

#include"stdio.h"
main()
{
int a;
printf("Enter the decimal");
scanf("%d",&a);
printf("the hexadecimalfor %d is %x",a,a);
return 0;
}

Is This Answer Correct ?    13 Yes 29 No

how to convert decimal to hexadecimal without using arrays just loops..

Answer / kiran123456789

#include<iostream.h>
#include<conio.h>
void main()
{
int a;
cout<<"Entrer a number";
cin>>a;
cout>>(hex)a;
getch();
}

Is This Answer Correct ?    9 Yes 29 No

Post New Answer

More C C++ Errors Interview Questions

#include<stdio.h> void main() { int i=1; printf("%d%d%d",i++,++i,i); }

19 Answers  


void main() { int i=5; printf("%d",i+++++i); }

14 Answers   HCL,


what is the large sustained error signal that eventually cause the controller output to drive to its limit

1 Answers   TCS,


what is syntax error?

3 Answers  


Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.

1 Answers  






Write down the difference between c. Loop and goto statement d. (!0) and (!1) e. (1= =! 1) and (1!=1) f. NULL and !NULL

0 Answers  


void main() { int i=7; printf("N= %*d",i,i); }

6 Answers   HCL,


Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;

3 Answers  


who was the present cheif governor of reserve bank of india

6 Answers   State Bank Of India SBI,


char* f() return "hello:"; void main() {char *str=f(); }

1 Answers  


Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it.

1 Answers   Google,


which typw of errors ? & how to solve it ?

0 Answers  


Categories