30) C PROGRAM CONVERT DECIMAL NUMBER INTO BINARY NUMBER
LOGIC:- First take any number which is in decimal form, now store the number in variable (n).we know binary no. is in 0 and 1 form only which is produced when number divide by 2 and remainder is in only form of 0 and 1.Store every remainder in an array.Then print the array in reverse order,which is the binary form of the decimal number.
EXAMPLE:-
NOW CONVERT BINARY INTO DECIMAL NUMBER
LOGIC:- For this program we find the decimal number(10 power),so multiply the binary digits from 2 and increase the power of 2 therefore pow function is used which is present in math.h header file.
EXAMPLE:-
TASK """SIMILARLY CONVERT OTHER NUMBERS"""
Comments
Post a Comment