An algorithm to find the largest among three different numbers

algorithm

How to start writing algorithm : Step by Step solve the problem Problem Description – Find description of the problem. Problem Analysis – Analyze the problem. Start writing steps to resolve the problem in your language. Re-analyze the steps and try to add more details. Final Review   An algorithm to find the largest among three … Read more

Basic of Algorithm : Start Writing Algorithm

algorithm

Basic of Algorithm : Start Writing Algorithm Algorithm are the set of well defined instruction in sequence to solve a problem. This is a instruction written in English language,  step by step to solve the problem An algorithm should always have a clear stopping point. Inputs and outputs should be defined precisely. Each steps in … Read more

binary search program in C

binary search program in C Overview: C Program for binary search This is a program of binary search in C language. It can only be used for sorted arrays, but it’s fast as compared to linear search. If you wish to use binary search on an array which isn’t sorted, then you must sort it … Read more

C program to find number of days in a month

C Programming Tutorial

C program to find number of days in a month This is a simple program to get number of days in a month. Leap year is not being chacked in the program. This program uses switch case. #include <stdio.h> int main() { int month; int days; printf(“Enter month: “); scanf(“%d”,&month); switch(month) { case 4: case … Read more

C Program to Check Even or Odd number

turbo c++ program editor

C Program to Check Even or Odd number : C Program Example An even number is an integer that is exactly divisible by 2. Example: 2,4,6, 8,10,12,14,16 etc An odd number is an integer that is not exactly divisible by 2. Example: 1, 3,5,7, 9,11, 15,17 etc C Program start from here #include int main() … Read more

Switch Case Control Structure in C

C Programming Tutorial

In real life we are often faced with situations where we are required to make a choice between a number of alternatives rather than only one or two. For example, what subject to choose after 10th, which school or college to join or which place to visit. We almost always end up making a wrong … Read more

C program to Check VOWEL or CONSONANT

C Programming Tutorial

C program to Check VOWEL or CONSONANT This program is written in c language. This is a example of switch case. This will read a character from user as input and check whether it is VOWEL or CONSONANT. #include <stdio.h> int main() { char ch; printf(“Enter a character: “); scanf(“%c”,&ch); //condition to check character is … Read more

C program to print digital clock

C Programming Tutorial

C program to print digital clock This program is written in C Language using graphics. This will show day, month, date, current time and year as output.   Logic for the digital clock program Initialize hour, minute, seconds with 0. Run an infinite loop. Increase second and check if it is equal to 60 then increase … Read more

graphics program for traffic light in C++

C Programming Tutorial

Here is traffic light program written in C++ using graphics.h header file. This program is Compiled using Turbo C++. /*Program for traffic Light*/ #include<iostream.h> #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> void main() { clrscr(); int gd = DETECT, gm, midx, midy; initgraph(&gd, &gm, “C:\\TC\\BGI”); midx = getmaxx()/2; midy = getmaxy()/2; setcolor(CYAN); settextstyle(TRIPLEX_FONT, HORIZ_DIR, 4); settextjustify(CENTER_TEXT, CENTER_TEXT); outtextxy(midx, midy-10, “Traffic Light … Read more

program in C to get the largest element of an array

C Programming Tutorial

program in C to get the largest element of an array Problem Statement: Write a program in C to get the largest element of an array using the function.   Test Cases: Input the number of elements to be stored in the array :10 Input 10 elements in the array : element – 0 : … Read more