In some interviews or exams, a problem is provided to the interviewee or student to find out the occurrence of the character in a string. In this example, I will help you in solving that problem/program with the easiest approach.
Monday, 7 September 2020
Program to find the occurrence of the character in a string in C#
Sunday, 6 September 2020
Program to Swap two numbers in C#
Write a program to Swap two numbers in C#
In many Interviews, the Interviewer asks the Interviewee to write a program to swap two numbers. There are multiple methods/ways to swap numbers in C#, out of which two popular methodologies are Swapping two numbers with third/temporary variable and another is swapping two numbers without using a third/temporary variable (using + and – arithmetic operator). Let’s see both approaches in detail.
|
int num1, num2, temp; //Get two number from the user to swap Console.WriteLine("Enter
first number"); num1 = int.Parse(Console.ReadLine()); Console.WriteLine("Enter
second number"); num2 = int.Parse(Console.ReadLine()); Console.WriteLine("Values
before swapping: num1=" + num1 + " and num2=" + num2); temp = num1; num1 = num2; num2 = temp; Console.WriteLine("Values
after swapping: num1=" + num1 + " and num2=" + num2); //Console.ReadLine() to hold the screen after the execution of
the program Console.ReadLine(); |
|
int num1, num2; //Get two number from the user to swap Console.WriteLine("Enter
first number"); num1 = int.Parse(Console.ReadLine()); Console.WriteLine("Enter
second number"); num2 = int.Parse(Console.ReadLine()); Console.WriteLine("Values
before swapping: num1=" + num1 + " and num2=" + num2); num1 = num1 + num2; num2 = num1 - num2; num1 = num1 - num2; Console.WriteLine("Values
after swapping: num1=" + num1 + " and num2=" + num2); //Console.ReadLine() to hold the screen after the execution of
the program Console.ReadLine(); |
Saturday, 5 September 2020
Top C# Programs for Interview
As I got several emails regarding the help for the Interview, so, I decided to share the programs that are asked during the interview. These programs also help you in an understanding of the problems/algorithms in the easiest way. I will update the programs every week so stay tuned. You can also write an email (or comment in the comment box) to me for any specific program required.
Top C# Program for Interview:
I hope these programs will help you in cracking your interview.
Thanks
Program to find Factor of a number in C#
Write a program to find the Factor of a number entered by the user.
The basic approach to solve this problem is to find the number(s) (Factors) which can divide the number entered by the user with no remainder left i.e. 0. In simple words, a factor divides a number completely without leaving any remainder.
Thursday, 20 August 2020
Working up with Google Kubernetes Engine in Google Cloud Platform
In this article, we will learn How to get started with GKE i.e. Google Kubernetes Engine in Google Cloud Platform. GKE provides the easiest and simplest way to set up the Kubernetes cluster. Kubernetes (K8s) is an Open Source system for automating deployment, scaling, and management of the containerized applications.
Wednesday, 12 August 2020
Getting Started with Cloud SQL in Google Cloud Platform
In this article, we will learn How to get started with Cloud SQL in Google Cloud Platform. We will start with the creation of a VM Instance. Then we create a MySQL DB in the Cloud SQL and access that DB in the Web application hosted in the VM Instance created in the Google Cloud Platform.











