C switch case program to read weekday number and print weekday name

C Programming Tutorial

C switch case program to read weekday number and print weekday name This program will read weekday number (0-6) and print weekday name (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday)   Weekday Number Weekday Name 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday Program Example: #include <stdio.h> int main() … 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

if else statement in c

C Programming Tutorial

The if statement by itself will execute a single statement, or a group of statements, when the expression following if evaluates to true. It does nothing when the expression evaluates to false. Can we execute one group of statements if the expression evaluates to true and another group of statements if the expression evaluates to … 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

JavaScript

javascript

This section will provide you with the basics of what JavaScript is, and why you should use it. Objectives     JavaScript versus JAVA     Interpreted programs versus Compiled programs     Why JavaScript     What you can use JavaScript for     About JavaScript JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric … 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

write a C program to calculate the sum of its digits

C Programming Tutorial

Problem Statement: If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits. Answer: /* Sum of digits of a 5 digit number*/ #include<stdio.h> #include<conio.h> main() { int num,a,n; int sum=0; /* this has been initialised to zero otherwise it will contain a garbage value */ clrscr(); … 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