C/C++ Programms

To reverse the given string using pointer

To reverse the given string using pointer

This is the program to reverse the given string and display. The program internally uses the logic of reversing the word. Logic: The approach here is to reverse the string using the pointers. Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

To reverse the given string

To reverse the given string

Here is the program to reverse the given string and display. The program internally uses the logic of reversing the word. Logic: Reversing the string includes the reversing the each and every words in it. After accepting a string from user, it calls a function “strev” with two string arguments, the source and destination. It […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

To copy the contents of one string to another string using pointer

To copy the contents of one string to another string using pointer

This is the simple implementation of the “Copy” function using the pointers. This program copies the content of one string to another. Logic : The program asks the user to input the string to copy and stores using the pointer str1. The inner function “stcpy” takes 2 string pointers as arguments. By keeping the length […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

To copy the contents of one string to another string

To copy the contents of one string to another string

This is the simple implementation of the “Copy” function of the computer world. This program copies the content of one string to another. Logic : The program asks the user to input the string to copy and stores this as str1. The inner function “stcpy” takes 2 strings as arguments. By keeping the length as […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

To check whether the given string is palindrome-method 2

To check whether the given string is palindrome-method 2

Here is  another program, advanced version of the previous program, to check if the entered string is a palindrome. Palindrome is a string segment, which reads same from both the directions. The same method is implemented here in the program also. Logic :  The given string is referred by two names, where one is traced […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

To check whether the given string is palindrome-method 1

To check whether the given string is palindrome-method 1

Here is  the program to check if the entered string is a palindrome or not. As we have seen in the earlier cases, Palindrome is a string segment, which reads same from both the directions. The same method is implemented here in the program also. Logic :  The given string is reversed using a method, […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Program to concatenate two given string using Pointer

Program to concatenate two given string using Pointer

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 […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

Program to concatenate two given string

Program to concatenate two given string

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) […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone

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

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

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 […]

Share on FacebookTweet about this on TwitterDigg thisPin on PinterestShare on LinkedInShare on StumbleUponShare on TumblrShare on Google+Email this to someone