Program to concatenate two given string using Pointer

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 0 Comment

This is another example program to concatenate two given strings dynamically using the string pointers. Earlier program explains the way to concatenate two strings by direct method. Logic : The program is just up gradation of the previous program. Here the program takes two strings to concatenate. Stores that with pointers str1 and str2 pointed [...]

Program to concatenate two given string

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 0 Comment

This is the example program to concatenate two given strings dynamically, i.e. at the run time. Concatenating simply means that appending one string to another. Logic : Here the logic is simple that the program asks the user to enter the first string, succeeded by the  second string to concatenate. The EOL (End Of Line) [...]

Program to find the total number of palindrome in a given string

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 0 Comment

Here is  the program to find the total number of palindromes present in the entered sentence.  This program internally uses the logic to find the palindrome, discussed earlier. Logic :  The given string is traced word-by-word till the EOL. To trace the words, it uses the logic of earlier program, where we counted the number [...]

To count the number of vowels in a given string

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 4 Comments

Here is a program to count number of vowels present in an entered sentence. Logic:  Here variable ‘vowels’ is incremented whenever a vowel found in tracing. Logic behind this is very simple, that comparing each character to the set of vowels, predefined in an array. If this character is in the set of vowels then [...]

To count the number of words in a given string

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 3 Comments

This is the program to count number of words in the entered sentence. Logic: The logic behind this program is checking if the character in the sentence is a ‘blank’ and with the conditions that the next is not a blank character, or current character position is not equal to length of the sentence. If [...]

Program to find the transpose of a Matrix

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 0 Comment

Here is the program to transpose the entered matrix. The program asks for the order (M, N) of the matrix Soon after entering the order, the cursor takes to the proper position in the screen to input the matrix. User need to hit ‘Enter’ button after each entry. Logic :  A simple logic lies here. [...]

To find the sum of secondary diagonal of a Matrix

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 4 Comments

Here is the program to find the sum of the secondary diagonal elements (From right top to  left bottom ) of the entered integer square matrix. The program asks for the order (M, N)  [where M should equal N] of the matrix. Soon after entering the order, the cursor takes to the proper position in [...]

To find the sum of primary diagonal of a Matrix

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 1 Comment

Here is the program to find the sum of the primary diagonal elements (From left top to right bottom) of the entered integer matrix. The program asks for the order (M, N)  [where M should equal N] of the matrix. Soon after entering the order, the cursor takes to the proper position in the screen [...]

To multiply two Matrices

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 1 Comment

Here is the program to find the product of the two integer matrices. The program asks for the order A (M, N) of the first matrix, and that B (P, Q) of the second matrix.  Soon after entering the order, the cursor takes to the proper position in the screen to input the matrices. User [...]

To find the difference of two Matrices

Thursday, December 4th, 2008  »  Posted By Ranjith  »  Total 0 Comment

Here is the program to find the difference between the two integer matrices. The program asks for the order (M, N) of the matrices. Soon after entering the order, the cursor takes to the proper position in the screen to input the matrices. User need to hit ‘Enter’ button after each entry. Logic : The [...]

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup