C program to print hollow right triangle star pattern
Example Input Input rows: 5
Learn to Code and Code to Learn
Your Journey to Code Mastery
Example Input Input rows: 5
Example Input Input rows: 5 Output 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 Pascal Triangle Pascal triangle is a triangular number pattern named after famous mathematician Blaise Pascal. For example Pascal triangle with 6 rows.
Example Input Input hexadecimal: 1A Output Decimal number: 26 Logic to convert Hexadecimal to Decimal
Example Input Input hexadecimal: 1A Output Octal number: 32 Logic to convert hexadecimal to octal There isn’t any easy and direct conversion algorithm from hexadecimal to octal number system. Below is the step by step descriptive logic to convert hexadecimal to decimal number system. Convert the given hex number to binary. Group the converted binary in…
Read More “C program to convert Hexadecimal to Octal number system” »
Example Input Input hexadecimal: 1A Output Decimal number: 26 Logic to convert Hexadecimal to Binary number system Hexadecimal to binary conversion is divided in three steps. Extract each hex digits separately. Find the binary of each extracted hex digit. Store the binary equivalent of extracted hexadecimal number to final bin variable. Repeat the above three…
Read More “C program to convert Hexadecimal to Binary number system” »
Example Input Input decimal number: 26 Output Hexadecimal number: 1A Algorithm to convert decimal to hexadecimal number system Algorithm Conversion from Decimal to Hexadecimal begin: read (decimal); hex ← NULL; rem ← 0; HEXVALUES[] ← 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F; While(decimal != 0) begin:…
Read More “C program to convert Decimal to Hexadecimal number system” »
Example Input Input decimal: 22 Output Octal number: 26 Algorithm to convert decimal to octal Algorithm Decimal to Octal conversion begin: read(decimal); octal ← 0; place ← 1; rem ← 0; While (decimal > 0) do begin: rem ← decimal % 8; octal ← (rem * place) + octal; place ← place * 10; decimal…
Read More “C program to convert Decimal to Octal number system” »
Example Input Input decimal number: 112 Output Binary number: 0111000 Algorithm to convert from decimal to binary Algorithm Decimal to Binary conversion begin: read (decimal); binary ← 0; place ← 1; rem ← 0; while (decimal > 0) do begin rem ← decimal % 2; binary ← (rem * place) + binary; place ← place…
Read More “C program to convert Decimal to Binary number system” »
Example Input Input octal number: 175 Output Hexadecimal number: 7D Logic to convert octal to hexadecimal There is no direct conversion from octal to hexadecimal number system. You first need to convert the given octal to binary number system. Then binary number system is converted to hexadecimal number system. Below is the step by step…
Read More “C program to convert Octal to Hexadecimal number system” »
Example Input Input octal number: 172 Output Decimal number: 122 Logic to convert from octal to decimal