Sunidhi Bansal has Published 1100 Articles

Program to Convert Hexadecimal to Octal in C program

Sunidhi Bansal

Sunidhi Bansal

Updated on 20-Nov-2019 10:05:51

1K+ Views

We are given a Hexadecimal number as string; the task is to convert it to the Octal. To convert a hexadecimal number to octal, we have to −Find the binary equivalent to the hexadecimal number.Convert the binary number to Octal.What are hexadecimal numbersHexadecimal numbers are the numbers which are of ... Read More

C Program to check if a number is divisible by any of its digits

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:59:18

1K+ Views

Given a number n, task is to find that any of the digit in the number divides the number completely or not. Like we are given a number 128625 is divisible by 5 which is also present in the number.ExampleInput: 53142 Output: yes Explanation: This number is divisible by 1, ... Read More

C Program for product of array

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:53:57

8K+ Views

Given an array arr[n] of n number of elements, the task is to find the product of all the elements of that array.Like we have an array arr[7] of 7 elements so its product will be likeExampleInput: arr[] = { 10, 20, 3, 4, 8 } Output: 19200 Explanation: 10 ... Read More

C Program for Arrow Star Pattern

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:49:31

1K+ Views

Given a number n and we have to print the arrow star pattern of maximum n number of stars.The star pattern of input 4 will look like −ExampleInput: 3 Output:Input: 5 Output:The approach used below is as follows −Take input in integer.Then print n spaces and n stars.Decrement till n>1.Now ... Read More

C Program for subtraction of matrices

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:42:24

777 Views

Given two matrices MAT1[row][column] and MAT2[row][column] we have to find the difference between two matrices and print the result obtained after subtraction of two matrices. Subtraction of two matrices are MAT1[n][m] – MAT2[n][m].For subtraction the number of rows and columns of both matrices should be same.ExampleInput: MAT1[N][N] = { {1, ... Read More

C Program to check if an array is palindrome or not using Recursion

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:35:40

1K+ Views

Given an array arr[n] where n is some size of an array, the task is to find out that the array is palindrome or not using recursion. Palindrome is a sequence which can be read backwards and forward as same, like: MADAM, NAMAN, etc.So to check an array is palindrome ... Read More

C Program to check if a number is divisible by sum of its digits

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:28:40

1K+ Views

Given a number n we have to check whether the sum of its digits divide the number n or not. To find out we have to sum all the numbers starting from the unit place and then divide the number with the final sum.Like we have a number “521” so ... Read More

C Program to check if the points are parallel to X axis or Y axis

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:24:32

366 Views

Given n number of points we have to check that whether the point is parallel to x-axis or y-axis or no axis according to a graph. A graph is a figure which is used to show a relationship between two variables each measured along with axis at right angles. Parallel ... Read More

C Program to check if two strings are same or not

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:18:33

9K+ Views

Given two strings str1 and str2 we have to check whether the two strings are same or not. Like we are given two stings “hello” and “hello” so they are identical and same.Identical are the strings which seems equal but are not equal like : “Hello” and “hello”, and same ... Read More

C Program for replacing one digit with other

Sunidhi Bansal

Sunidhi Bansal

Updated on 21-Oct-2019 11:14:31

3K+ Views

Given a number n, we have to replace a digit x from that number with another given number m. we have to look for the number whether the number is present in the given number or not, if it is present in the given number then replace that particular number ... Read More

Advertisements