## C Program Date is Valid or Not

by Dinesh Thakur Category: Control Structures

Let us use variables dd,mm and yy (all of type int)to represent the day, month and year in a given date. The given date is valid only if year (yy)is non-zero, month (mm)is in the range 1 to 12 and day of month (dd) is in the range 1 to mdays, the number of days in a given month mm. An algorithm to determine the validity of a given date is given below.

## C program to calculate tax, given the following conditions

by Dinesh Thakur Category: Control Structures

1. if income is less thn, 1,50,000 then no tax
2. if taxable income is in the range 1,50,001-300,000 then charge 10% tax
3. if taxable income is in the range 3,00,001-500,000 then charge 20% tax
4. if taxable income is above 5,00,001 then charge 30% tax.

## C Program for print a name of color that start with a given character

by Dinesh Thakur Category: Control Structures

The program segment given below accepts a character from the keyboard and prints the name of the corresponding color, e. g., if the user enters character R, it prints Red. However, it handles only three colors, namely, red, green and blue.

## C Program square and cube of first n natural numbers

by Dinesh Thakur Category: Control Structures

## C Program for string encryption using Caesar cipher (shift encoding).

by Dinesh Thakur Category: Control Structures

C program to encrypt text using one of the simplest ciphers known as the "Caesar cipher." In this encryption scheme, we shift all characters by a given offset. For example, if we use an offset of 4, every occurrence of 'A' will be replaced by 'E', every occurrence of 'B' will be replaced by 'F', and so forth. The encrypted text can be decrypted by using the reverse process if know the offset used for the encryption.

## C Program Sum of Digits of a Given Integer Number

by Dinesh Thakur Category: Control Structures

we determined the sum of digits of a non-negative integer number by determining the least significant digit and then removing it from given number.

## C Program print a given integer number in words

by Dinesh Thakur Category: Control Structures

Consider that we wish to print a given positive integer number in words, as a sequence of digit strings. For example, number 123 should be printed as One Two Three. This might be required in financial applications, for example, to print the cheque amount in words.

## Find the efficiency of the worker.

by Dinesh Thakur Category: Control Structures

## Nested if Statements in C Language

by Dinesh Thakur Category: Control Structures

The C language allows nested if statements in which the if block and/or else block of an if statement contains if or if-else statements. The inner if statement(s) may in turn contain other if statements and so on.

## What is the difference between IF-ELSE and SWITCH?

by Dinesh Thakur Category: Control Structures

Both the switch and if-else-if statements enable us to select one of several alternative statements for execution. However, they differ in several aspects:

Page 3 of 7

Dinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Search Content

Popular Article