×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Tutorix
Login
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Q/A
Library
eBooks
Courses
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Hafeezul Kareem
has Published
387
Answers
Nearest 1 in a binary matrix in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 10:05:10
Given a binary matrix, we need to find the minimum distance from each cell to the nearest cell that contains 1.Let's see an example.Input0 0 1 1 1 0 0 0 0Output1 1 0 0 0 1 1 1 2The minimum distance is the one that is minimum from current ...
Read More
Natural Numbers in C++ Program
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:59:00
Numbers that are greater than 0 are called natural numbers. The natural number are1, 2, 3, 4, 5, 6, 7...AlgorithmInitialise the number n.Write a loop that iterates from 1 to n.Print the numbers.Increment the iterative variable.ImplementationFollowing is the implementation of the above algorithm in C++#include <bits/stdc++.h> using namespace std; void ...
Read More
Narayana number in C++
Hafeezul Kareem
Published on 29-Jun-2021 09:50:39
The Narayana numbers can be expressed in terms of binomial expression $1/n\binom{n}{k} \binom{n}{k-1}$ Learn more about the Narayana number here.You are given the numbers n and k. Find the Narayana number. It's a straightforward problem having the combinations formula. Let's see the code.AlgorithmInitialise the numbers n and k.Find the Narayana ...
Read More
N’th Smart Number in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:47:32
A smart number is a number that contains at least three distinct prime factors. You are given a number N. Find the n-th smart number.The smart number series are30, 42, 60, 66, 70, 78...AlgorithmInitialise the number N.Initialise the count to 0.Write a function that checks whether the given number is ...
Read More
n’th Pentagonal Number in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:42:20
In this tutorial, we are going to write a program that finds the n-th pentagonal number.A pentagonal number is a number represented as dots or pebbles arranged in the shape of a regular polygon. Refer to the wiki for better understanding.The n-th pentagonal number is (3 * n * n ...
Read More
N’th palindrome of K digits in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:40:19
To find the n-th palindrome of k digits, we can iterate from the first k digits number till we find the n-th palindrome number. This approach is not efficient. You can try it yourself.Now, let's see the efficient approach to find the n-th palindrome of k digits.There are two halves ...
Read More
n-th term of series 1, 17, 98, 354…… in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:35:42
The given series is 1, 17, 98, 354...If you clearly observe the series, you will find that the n-th number is equal to the 4 powers.Let's see the pattern. 1 = 1 ^ 4 17 = 1 ^ 4 + 2 ^ 4 98 = 1 ^ 4 + 2 ...
Read More
N-th term in the series 1, 11, 55, 239, 991,…in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:31:01
The given series is 1, 11, 55, 239, 991...If you clearly observe the series, you will find that the n-th number is 4n-2n-1.AlgorithmInitialise the number N.Use the series formula to compute the n-th term.Print the result.ImplementationFollowing is the implementation of the above algorithm in C++#include <bits/stdc++.h> using namespace std; int ...
Read More
n-th term in series 2, 12, 36, 80, 150….in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:28:01
The given series is 2, 12, 36, 80, 150...If you clearly observe the series, you will find that the n-th number is n2 + n3.AlgorithmInitialise the number N.Use the series formula to compute the n-th term.Print the result.ImplementationFollowing is the implementation of the above algorithm in C++#include <bits/stdc++.h> using ...
Read More
N-th root of a number in C++
C++
Server Side Programming
Programming
Hafeezul Kareem
Published on 29-Jun-2021 09:21:40
You are given the N-th root and the result of it. You need to find the number such that numberN = result.Let's see some examples.Input result = 25 N = 2Output 5The 52 = 25. Hence the output in the above example is 5.Inputresult = 64 N = 3Output4 The ...
Read More
Previous
1
...
4
5
6
7
8
9
10
...
39
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout