Saturday, 23 January 2021

Program to Count Vowels and Consonants in a string

One of the popular programs which can be asked by the interviewer during the interview is to count no. of Vowels and Consonants in a string. The letters A, E, I, O, and U are called Vowels and the other letters (except vowels) in the alphabet are known as Consonants.

Friday, 11 December 2020

Wednesday, 4 November 2020

Exception Handling in SQL Server

In this Article, we will learn How to Handle Exception in SQL Server and also see How to capture or Log the Exception in case of any DB Level Exception occurs so that the Developer can refer to that Error log, can check the severity of the Exception, and fix it without wasting too much time in finding the exception causing procedure or function or line which is causing the exception.

Sunday, 25 October 2020

Program to generate Floyd’s Triangle in C#

Floyd’s triangle is a right-angled triangle of natural numbers used in computer science education. Floyd refers to the name after Robert Floyd. Floyd’s triangle is created by printing the consecutive numbers in the rows of the triangle starting from the number 1 at the top left corner.

I will recommend you to check the below link for Top C# Interview Programs asked during the Interview and Examination.
Program:

//Three variable one for outer loop, one for inner

//k to print the number

int i, j, k = 1;

for (i=1;i<=10;i++) {

    for (j=1;j<=i;j++) {

    //Print no. in console with horizontal space i.e. tab

    Console.Write(k++ + "\t");

    }

    //New Line

    Console.Write("\n");

}

//Console.ReadLine() to hold the screen after the execution of the program

Console.ReadLine();

Preview:

I hope this program will help you in your exam as well as Interview preparation.
Thanks

Sunday, 27 September 2020

Deployment Manager and Monitoring in Google Cloud Platform

In this article, we will learn How to use the Deployment Manager to deploy VM Instance as well as monitor them in the Google Cloud Platform. If you are new to this series of Google Cloud Platform, I will recommend you to go through the below articles of this series:


Saturday, 19 September 2020

Program to find the HCF of two numbers in C#

In this blog, we will learn How to find the HCF of two numbers in C#. If you are looking for Programs asked in C# Interview, check the below link:


HCF Stands for Highest Common Factor. It is also called the Greatest Common Measure (GCM) and Greatest Common Divisor (GCD). For finding the HCF, we need to find the greatest number which divides two or more numbers.


Check the below C# program, for calculating the HCF of two numbers in C#. I have mentioned comments as well for easy understanding.

int num1, num2, loopCheck, hcf=0;

//Prompt user to add two number for which HCF needs to find

Console.WriteLine("Enter First Number");

num1 = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("Enter Second Number");

num2 = Convert.ToInt32(Console.ReadLine());

//set the min value out of the numbers entered by the user

loopCheck = num2 > num1 ? num1 : num2;

//Loop the data from 1 to the loopCheck value

for (int i = 1; i <= loopCheck; i++)

{

    //If Modulus of both number will be Zero than store it in hcf variable

    if (num1 % i == 0 && num2 % i == 0)

    {

        hcf = i;

    }

}

//Show the output to the User

Console.Write("HCF of {0} and {1} is: {2}", num1, num2, hcf);

//Console.ReadLine() t

Output:

I hope this will help you with your interview preparation or exam.
Thanks

Subscribe Now

Popular Posts

Contact us

Name

Email *

Message *

Subscribe us on YouTube

Like us on Facebook

Follow us on Google+