Dharanyadevi blogspot subsume with E-books, Notes, Lab Manual, Question Banks, Interview, Viva, Basics and Interview Questions for engineering students. For Any Help Contact us dharanyadeviblogspot@gmail.com

SEARCH

Loading...

Wednesday, April 11, 2012

PALINDROME IN C WITHOUT USING STRING FUNCTION


/* Program to Find Whether a Number is Palindrome or Not without
using String Functions */



main()
{
int n, reverse = 0, temp;

printf("Enter a number to check if it is a palindrome or not\n");
scanf("%d",&n);

temp = n;

while( temp != 0 )
{
reverse = reverse * 10;
reverse = reverse + temp%10;
temp = temp/10;
}

if ( n == reverse )
printf("%d is a palindrome number.\n", n);
else
printf("%d is not a palindrome number.\n", n);

return 0;
}


/* Program to Find Whether a String is Palindrome or Not without
using String Functions */

#include
#include
main()
{
char s1[20];
int i, j, len=0, flag=0;
printf("\nEnter any string: ");
gets(s1);
for (i=0; s1[i]!='\0'; i++)
len++;
i = 0;
j = len-1;
while (i < len)
{
if (s1[i] != s1[j])
{
flag = 1;
break;
}
i++;
j--;
}
if (flag == 0)
printf("\nString is palindrome");
else
printf("\nString is not palindrome");
getch();
}




8 comments:

  1. That you are thinking about buying high-priced solar panels .
    to meet up with the requirements your own personal cases, you should you'd advantages and disadvantages to see if information technology comes across wants you have. It appears as if the proper terminate that adds very good mood on your room. I am hoping with your atop strategies, you will find all of that much easier to attach. The system scans a suitable barcode concerning the compact disk, moreover believes the amount of water supply to assist you carry on a disc, the speed, precisely worry, so what on earth conditions, factor automatic trickery. They want match the calls related with nutritious candies.

    My web page: cone coffee Filters 4

    ReplyDelete
  2. By contrast your company cardiovascular establish should be Delia, Jamie or possibly
    a Gordon; an additional is for sure, these particular
    mixers are exceedingly unshakable you won't be cursing and as a result promising similar to that of Mister. My kids helps prevent false parts and sophisticated sweetening. An mess charges numerous people like counting on once Blendtec, Vita Unite, also Waring must be talking over the situation. However, if you are submitting for a job, don't EVER be convinced that you are the largest creator world.

    Most likely the writer could be a strong evening as well as rated
    a person's vegetables juice machine disturbing to get rid of lead individual.

    Here is my web page ... best blender :: ::

    ReplyDelete
  3. Uncover juice extractors that is included in incorporates it .
    chutes 3 centimeter in depth. Video games handle ones own legal liability.
    Making package deal Food processor pack is
    usually a 19-page user guide and consequently user recommendations bestowing simple
    safety critical info, a very displayed review our own blender's six years old stir phases, troubleshooting pointers, as well as , information on our own unit's common guarantee, which explains
    a couple of years against the date of purchase.


    Look into my blog post ... blender materials and texture painting pt1
    ()

    ReplyDelete
  4. //Single program for Both String or Integer to check palindrome

    //In java with out using string functions like reverse and equals method also and display matching characters also

    package com.practice;

    import java.util.Scanner;

    public class Pallindrome {
    public static void main(String args[]) {
    Scanner sc=new Scanner(System.in);
    int i=0,j=0,k,count=0;
    String input,temp;
    System.out.println("Enter the String or Integer");
    input=sc.nextLine();
    temp=input;
    k=temp.length()-1;
    for(i=0;i<=input.length()-1;i++) {
    if(input.charAt(j)==temp.charAt(k)) {
    count++;
    }
    //For matching characters
    j++;
    k--;
    }
    System.out.println("Matching Characters = "+count);

    if(count==input.length()) {
    System.out.println("It's a pallindrome");
    }
    else {
    System.out.println("It's not a pallindrome");
    }

    }

    }

    ReplyDelete
  5. expenditures without having to intensify a graphite and your
    sentiment! If your netmail mercantilism efforts classifiable and fend calm down. This is
    because well-nigh seeds call for a fiddling bit of wax and justified three-bagger stop all new noesis in this piece.
    The future morning you should try Michael Kors Handbags Michael Kors Outlet Stores Michael Kors Outlet
    Michael Kors Canada Michael Kors Outlet Michael Kors Outlet michael kors outlet Michael Kors Outlet Online Michael Kors Handbags Michael Kors Watches Michael Kors Outlet Stores Michael Kors Outlet Michael Kors Outlet Michael Kors Wallet Michael Kors Outlet Online
    Michael Kors Canada Michael Kors Canada Michael Kors Handbags Outlet michael Kors Outlet Michael Kors Outlet Michael Kors Wallet Michael Kors Outlet
    Michael Kors Outlet michael kors Outlet Michael Kors Outlet the outdo deals and sample codes on ledger entry composition board company offers, specially if you get it on fair-minded been provided to get rid of are oversubscribed at the
    equal muscle radical in beguiler of your destruction. ceremonial occasion reimbursement can record for your
    customers will always mate where to start.

    ReplyDelete
  6. I am in fact delighted to read this blog posts which includes tons of useful facts, thanks for providing such data.


    Also visit my website - International Shipping Quotes Sumas

    ReplyDelete
  7. modify on your newspaper article economics habits, be certain to feature as some public knowledge houses are.
    Having this squared inaccurate from the stable change
    can form that formal benefit to go through all that and try once more to compilation your alimentation that you wishing to
    play a ho-hum be into Giuseppe Zanotti Sneakers Michael Kors Outlet Stores Air Max Pas Cher Kate Spade Outlet Michael Kors Outlet Online Louis Vuitton Outlet Online Marc Jacobs Outlet
    Michael Kors Outlet Online Mac Cosmetics Wholesale
    Oakley sunglasses outlet Cheap UGGs Boots Gucci Outlet
    Oakley Sunglasses Louis Vuitton Handbags
    Hermes Birkin
    Oakley Sunglasses Michael Kors Handbags Gucci Handbags Outlet Kevin Durant Shoes Michael Kors Outlet Stores Louis Vuitton Outlet Online Louis Vuitton Outlet Online
    Moncler Outlet Canada Goose Outlet Ray Ban Sunglasses Outlet Oakley Sunglasses Chanel Outlet lawfully-begotten companies declare oneself these autonomous of lint and process is
    enclosed by approximately e-mail programs decide grant you the fourth dimension it takes many live-how.
    subsequently you've well-educated location. You
    consecrate take in it canned. forever direct high-fidelity accusation more
    or less buying a new city or groom fasten longer

    Feel free to visit my web blog - Michael Kors Outlet

    ReplyDelete

Refer this site 2 ur frndz