Sudhir sharma has Published 1149 Articles

Write a C program that displays contents of a given file like 'more' utility in Linux

sudhir sharma

sudhir sharma

Updated on 17-Jul-2020 10:48:40

259 Views

Here, we will write a C program that will display the contents of a file page by page as displayed in Linux using the more command.This program will show a specific number of lines on the screen first and then wait for the user to hit enter to move to ... Read More

Write a program to print ‘Tutorials Point’ without using a semicolon in C

sudhir sharma

sudhir sharma

Updated on 15-Jul-2020 06:40:59

232 Views

In this problem, we have to write a program that will print ‘Tutorials Point ’ without using a semicolon.We all know that to end a statement in c semicolon is necessary. And print statement will be executed when a semicolon is added at the end.So, for printing ‘Tutorials point’ without ... Read More

Write a C program to print ‘ABCD’ repeatedly without using loop, recursion and any control structure

sudhir sharma

sudhir sharma

Updated on 15-Jul-2020 06:31:02

243 Views

In this problem, we have to write a program in c that will print a string ‘ABCD’ repeatedly without using loop, recursion and any control structure.So, we will have to call or run the same block of code infinite time but without using loop, recursion or control structure which are ... Read More

Write a function that counts the number of times a given int occurs in a Linked List in C++

sudhir sharma

sudhir sharma

Updated on 15-Jul-2020 06:26:14

459 Views

In this problem, we are given a linked list. Our task is to create a function that will be able to count the number of times a given number occurs in the linked list.Let’s take an example to understand the problem, InputLinked list = 10-> 50 -> 10 -> 20 ... Read More

Write a function that generates one of 3 numbers according to given probabilities in C++

sudhir sharma

sudhir sharma

Updated on 15-Jul-2020 06:23:43

360 Views

In this problem, we have to create a function that will generate three numbers based on the given probability.For this, we will use the built-in random number generator function which is rand(a, b) which generates random numbers within the range [a, b] with equal probability.Our task is to return only ... Read More

Write a function to delete a Linked List in C++ Programming

sudhir sharma

sudhir sharma

Updated on 15-Jul-2020 06:21:31

683 Views

Here, we will create a function that will delete all elements of a linked list one by one.In c/c++, there is no specific function to perform this task but in java, the automatic garbage collection is done to ease deleting linked list.Now, let’s see the implementation of this program, Example Live ... Read More

Print all palindromic paths from top left to bottom right in a matrix in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:36:48

219 Views

In this problem, we are given a matix which contains aplhabets (lowercase only) and we have to print all palidromic paths in the given matrix from top left to bottom right of the matrix.Allowed moves in this problem are right and down. Diagonal moves are not allowed.Let’s take an example ... Read More

Print all palindromic partitions of a string in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:35:42

204 Views

In this problem, we are given a palindromic string. And we have to print all the partitions of this string. In this problem, we will find all possible palindrome partitions of the string by cutting it.Let’s take an example to understand the problem -Input − string = ‘ababa’Output − ababa ... Read More

Print all palindrome permutations of a string in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:34:45

390 Views

In this problem, we are given a string and we have to print all the palindromic permutations that are possible from the characters of that string.Let’s take an example to understand the problem −Input − string = ‘aabb’Output − abba baabTo solve this problem we have to take the characters ... Read More

Print all pairs with given sum in C++

sudhir sharma

sudhir sharma

Updated on 14-Jul-2020 07:33:46

446 Views

In this problem, we are given an array of integers and an integer sum and we have to print all pairs of integers whose sum is equal to the sum value.Let’s take an example to understand the problem :Input − array = {1, 6, -2, 3} sum = 4Output − ... Read More

Advertisements