How to develop a program using C language to convert 8-bit
binary values to decimals. TQ
Answer / bashar khawaldeh
int arr[8];
int sum = 0;
int n = sizeof(arr) / sizeof(arr[0]);//24/4=6
for (int i = 0; i < n; i++) {
cout << "enter binary number
" << "index " << i << ":";
cin >> arr[i];
}
for (int i = 0; i < n; i++) {
if (arr[i] == 1) {
sum += pow(2,i);
}
}
cout << sum << endl;
| Is This Answer Correct ? | 0 Yes | 0 No |
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
how tally is useful?
how to convert decimal to binary in c using while loop without using array
50 Answers Apple, Aptech, Arwen Tech, BCS, C2D Software, CEC,
errors are known as?
3 Answers EX, State Bank Of India SBI,
I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX
What is the code for following o/p * * * * * * * * * * * * * * * *
What is probability to guarantee that the task a programmer is going to create will be created and be able to run on a particular system (RTOS/GPOS).
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
#include<>stdio.h> #include<>conio.h> { printf("hello"); void main() getch(); } what the out put of this program and why ......plz clear my answer
void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?
what is run time error?
what is meant for variable not found?