Sunidhi Bansal has Published 1101 Articles

Print the given 3 string after modifying and concatenating

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

157 Views

Input three strings and replace each string with a character which user has entered and then display edited strings. After that, concatenate edited strings and display them.Input:    string 1 : tutorials replacement character for string 1 : x    String 2 : points replacement character for string 2 : ... Read More

Print elements that can be added to form a given sum

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

156 Views

Input number of elements user want to enters and than input the total value user want to calculate from the given list of elements.Input : N=5    Enter any 5 values : 3 1 6 5 7    Enter sum you want to check : 10 Output : 3 1 ... Read More

Print missing elements that lie in range 0 – 99

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

159 Views

It will display the missing values from the given set entered by the userGiven : array = {88, 105, 3, 2, 200, 0, 10}; Output : 1 4-9 11-87 89-99AlgorithmSTART STEP 1-> Take an array with elements, bool flag[MAX] to Fale, int i, j, n to size of array Step ... Read More

Print uncommon elements from two sorted arrays

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

2K+ Views

Given two sorted arrays and output should display their uncommon elementsGiven : array1[]= {1, 4, 6, 9, 12}    array2[]= {2, 4, 7, 8, 9, 10} Output : 1 2 6 7 8 10 12AlgorithmSTART Step 1 -> declare two arrays array1 and array2 with elements as int and variables ... Read More

Print first N terms of series (0.25, 0.5, 0.75, …) in fraction representation

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

117 Views

Input N which is equivalent to the number till where series should be printedInput : N=5 Output : 0 ¼ ½ ¾ 1AlgorithmSTART Step 1 -> declare start variables as int num , den, i, n Step 2 -> input number in n Step 3 -> Loop For from i ... Read More

Print prime numbers from 1 to N in reverse order

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

2K+ Views

Input number n till which prime numbers are calculated and displayed in reverse orderInput : number 30 Output : 29 23 19 17 13 11 7 5 3 2AlgorithmSTART Step 1 -> declare variables as n, I, j, flag to 0 as int Step 2 -> input number in n ... Read More

Print numbers in descending order along with their frequencies

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

397 Views

Given with an array of int elements, the task is to arrange the elements in descending order and finding their occurrences.Input : arr[]={1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 7} Output : 7 occurs: 2    6 occurs: 1    5 occurs: 1    4 ... Read More

Print matrix in antispiral form

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

260 Views

Given a 2d array of n*n and the task is to find the antispiral arrangement of the given matrixInput : arr[4][4]={1, 2, 3, 4,    5, 6, 7, 8,    9, 10, 11, 12    13, 14, 15, 16} Output: 10 11 7 6 5 9 13 14 15 16 ... Read More

Print matrix in diagonal pattern

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

288 Views

Given a 2d array of n*n and the task is to find the antispiral arrangement of the given matrixInput : arr[4][4]={1, 2, 3, 4,    5, 6, 7, 8,    9, 10, 11, 12    13, 14, 15, 16} Output : 1 6 11 16 4 7 10 13AlgorithmSTART Step ... Read More

Print an array with numbers having 1, 2 and 3 as a digit in ascending order

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

526 Views

Here, the task is to print those number in an array having 1, 2 and 3 as digits in their numbers and if their is no such number than the output must be -1Input : arr[] = {320, 123, 124, 125, 14532, 126, 340, 123400, 100032, 13, 32, 3123, 1100} ... Read More

Advertisements