Skip to main content

Posts

Best Indian Technical Blog | TechGecs

There is no doubt about the fact that as time is changing day by day, technology is also changing at a very fast pace. Every day a new technology came into the picture that’s why this is going to be very urgent to be updated every second, and people from different places of the earth must keep hooked to it.    Although, there is a variety of tech influencers or tech bloggers in India that have expertise in their technical domain and they are really worthy to appreciate for their work, throughout the country. Technology has transformed our lives completely different from before. This niche is really has attracting nature across different spheres throughout the globe.  Well, if you came here while searching for the best Indian technical blog so, we have a deep discussion on the best tech blogs TechGecs , whose owner Ashish Pratap Singh updates his tech blog regularly. What makes the TechGecs outstanding in terms of performance and rank, is their approach and sense of understanding in t
Recent posts

Wave Array | Convert an array to a wave array

 You have given a sorted array a[ ] of distinct integers and you have to sort the array in a wave-like pattern. It will be arranged like a[0]>=a[1]<=a[2]>=a[3]<=a[4]... This question has been asked in Google, Microsoft, Adobe, Amazon, Goldman Sachs, Paytm , and FactSet . Input: n=5 a[ ] = {1, 2, 3, 4, 5} Output: 2 1 4 3 5 So how can we solve this problem? If our array is already sorted then we have to just swap the array at the alternate elements. Like for a[ ] = {1, 2, 3, 4, 5} Loop1: i=0, a[ ] = {2, 1, 3, 4, 5} Loop2: i=2, a[ ] = {2, 1, 4, 3, 5} for Loop 3: i=4 which is not less than n-1 i.e. 4. So the loop ends here. The array generated is forming a wave pattern: {2, 1, 4, 3, 5}. Cpp code: #include   <bits/stdc++.h> using   namespace   std ; int   main () {      int  n;     cin  >>  n;      int  a[n];      for  ( int  i  =   0 ; i  <  n; i ++ )         cin  >>  a[i];      for  ( int  i  =   0 ; i  <  n  -   1 ; i  +=   2 )     {          swap (a[

How to add 2 numbers without using an arithmetic operator?

 Guess you have to add two integers or numbers but without using the arithmetic operator. You cannot use any arithmetic operator like +, -, ++, --, ... etc. How will you do that? This question was asked in Microsoft Online Assessment. For solving this problem we have to go back to our Digital Electronics concepts where for adding two bits, we can do the XOR(^) of those bits. if they have a carry, we can find that out by applying AND(&) of them. So, this is the simple concept of Half Adder  which is used to add 2 single bits.  Input: 3 5 Output: 8 C++ code for this problem: #include   <bits/stdc++.h> using   namespace   std ; int   main () {      int  x, y, carry;     cin  >>  x  >>  y;      while  (y  !=   0 )     {         carry  =  x  &  y;         x  =  x  ^  y;         y  =  carry  <<   1 ;     }     cout  <<  x  <<   " \n " ;      return   0 ; } Explanation: Input: 3 5 For x=3 and y=5: Loop1: y = 5 != 0,                carry =

Setting up Cpp environment on VS Code | Windows 10

I have recently switched to Windows 10 from PopOs ( a Debian-based Linux) because of my project-related work which could not be done in any Debian-based Linux. So, I installed windows 10 on my system and it was just a little annoying but cool as well because my system's performance has increased (which was obvious as I have deleted all my previous data just backed up around 60Gb of it). So, starting with the process of setting up the environment for C++ on the VS Code on Windows 10. In Linux, I used to run C++ files on Sublime text only but on Windows, I'm just using VS code for both C++ and JavaScript. Let's start setting up the environment. I am dividing this whole process into 4 steps: First, you have to set up a compiler for the system. As we know that C/C++ is compiled programming language which requires a compiler to make them compiled and run. In Linux, there is already a gcc/g++ compiler preinstalled. But in Windows, you have to install it separately. So you can dow

TipsReport: Best Hindi Blog

 In this post, I'm going to write about a blog that I came across recently. Its name is TipsReport  ( https://tipsreport.com/ ), it's a Hindi blog and the content over there is just amazing.  So starting with the topics, that TipsReport is about. You can find a variety of articles here but most of them can be grouped with tags India, Tips and Tricks, Technology, Health, Education, and Quotes.   Some of the initial blogs on this blog were related to health like the Advantages of eating raisins, the Advantages of Jonk oil, etc.  One of the amazing things that I liked about this blog is that it has content that shares the government schemes, their benefits, and how to avail them. I am sharing one of them here: PMBBY Yojna.  This blog also speaks on many of the government policies and actions. It openly says their faults and gives a solution to them. This blog also covers some political news and movements. TipsReport also writes on the latest technology trends which are not only li

3 hacks to wake up early in the morning

So this is what everyone says that we have to wake up early in the morning. Yes, it's good to wake up early and this could be the best decision you will take in your life.   I have read this somewhere that " If you want to change your life, do nothing just start waking up early in the morning and things will start happening ". So yes waking up early in the morning is going to help you a lot and it will surely help in changing your life. Now the question that arises is how we can wake up early in the morning? We all want to wake up early at 5 or 6 Am in the morning but when the clock hits 5 and your alarm makes the sound, your mind says just 5 minutes more and these 5 minutes end up at 1 hour.  So the question is how can we make it to wake up early in the morning. So in this article, I'm sharing 3 hacks that can surely help you in achieving your goal of waking up early in the morning.  The secret of waking up early doesn't lie in the process of waking up early in

Cpp program to count digits in an integer

C++ program to count the number of digits in an integer: Suppose you have an integer, n = 1567. The number of digits in n is 4. Input: 1567 Output: 4 Input: 58694 Output: 5 Solution:  To solve this problem, we can simply iterate to all these digits starting from the rightmost digit. We will update the number by dividing it by 10 until it becomes less than or equal to zero. Step 1: n=1567, count=0.               n = n/10; count = count+1; Step 2: n=156, count=1.             n = n/10; count = count+1; Step 3: n=15, count=2.             n = n/10; count = count+1; Step 4: n=1, count=3.             n = n/10; count = count+1; Step 5: n=0; count=3;               Loop will end here. C++ implementation: #include   <bits/stdc++.h> using   namespace   std ; int   main () {     int  n ;     cin >>  n ;      int   count  =  0 ;      while  ( n  !=  0 )     {          n  =  n  /  10 ;          count ++;     }     cout <<  "Number of digits : "  <<  count ;      retu