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.

 
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.

 
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.

 
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.

 
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:

 
by Dinesh Thakur Category: Control Structures

The program segment given below prints four-digit special perfect square numbers in which the upper and lower two-digit numbers are perfect squares as well.

 
by Dinesh Thakur Category: Control Structures

The program segment given below determines the sum of digits of a given number repeatedly until a single digit number is obtained. For example, 5985 => 27 => 9, where symbol => indicates a digit sum operation. Thus, if digit sum exceeds 9, it is used as a number for subsequent digit sum operations.

 
by Dinesh Thakur Category: Control Structures

The for loop given above prints a line of fifty dashes followed by a newline. The for loop uses i as the loop variable whose initial and final values are 0 and 49, respectively (note the < operator in i < 50). The update expression increments the value of i by 1.

 
About Dinesh Thakur

Dinesh ThakurDinesh 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