Sudhir sharma has Published 1218 Articles

C Program for Number of stopping station problem

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:49:57

351 Views

Problem statement − A program to find the number of ways in which a train will stop in r stations out of n stations so that no two stopping stations are consecutive.Problem ExplanationThis program will calculate the number of ways i.e. permutations in which the train will stop. Here, the ... Read More

What is the Address of a function in C or C++?

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:44:02

2K+ Views

A function is a block of code that is defined to perform a specific piece of work in a program. It is used to ease the work of the programmer by defining a commonly occurring piece of code so that it can be reused when required.The address is the memory ... Read More

Adding elements of an array until every element becomes greater than or equal to k in C++.

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:32:43

126 Views

Array − An array is a container of elements of the same data type, whose elements are 0 indexed.In this problem, we will use an array of integers. And check if all the elements are greater than the given number or not. Here we will check if all elements of ... Read More

Add two unsigned numbers using bits in C++.

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:27:30

485 Views

An unsigned number represented as a stream of bits is written in binary form.The binary form of 54 is 110110.Adding two numbers using bits, we will add their binary form using the binary addition logic.Rules for bit addition is −0+0 = 01+0 = 10+1 = 11+1 = 0 with carry ... Read More

Add two numbers using ++ operator in C++.

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:23:00

632 Views

In programming, the ++ operator is the increment operator that increases the value of the operand by 1. We can add two numbers using this operator by adding 1 to the number a, b number of times.Example, Input: a = 31 , b = 4 Output: 35Explanation − adding 1 ... Read More

Add two numbers represented by two arrays in C Program

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:18:23

2K+ Views

A number represented by the array is stored in such a form that each digit of the number is represented by an element of the array. For example, Number 234 in array is {2, 3, 4}.To add to such numbers we will first add number at the least significant digit ... Read More

C/C++ Tricky Programs

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:11:14

4K+ Views

Here are 10 tricky programs that will test your programming basics.1. Program to print “ ” in C++In C++ programming language, we use quotes to denote the start and end of the text is to be printed. So, printing quotes “ needs a special escape sequence. So, we will use ... Read More

C/C++ Program for Greedy Algorithm to find Minimum number of Coins

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 08:02:59

5K+ Views

A greedy algorithm is an algorithm used to find an optimal solution for the given problem. greedy algorithm works by finding locally optimal solutions ( optimal solution for a part of the problem) of each part so show the Global optimal solution could be found.In this problem, we will use ... Read More

C++ vs C#

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 07:57:35

172 Views

C++ Programming languageA successor of the c programming language that has introduced the concept of classes and objects. It encapsulates features of c and high-level language hence it can be treated as an intermediate-level language. When it was created it was thought of as a C that has classes because ... Read More

C++ program to print unique words in a file

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 07:39:36

414 Views

A file is a memory location that stores word streams. In a file, there are various words. In this program, we will find all unique words from the file and print them.A unique word means the number of occurrences of the word is one in the file.For example, Tutorials point ... Read More

Advertisements