Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program of palindrome(madam=madam) using pointer?

Answer Posted / priyanka

#include<stdio.h>
#include<conio.h>
int stpal(char str[50]);
void main()
{
char str[50];
int pal;
clrscr();
printf(“nnt ENTER A STRING…: “);
gets(str);
pal = stpal(str);
if(pal)
printf(“nt THE ENTERED STRING IS A PALINDROME”);
else
printf(“nt THE ENTERED STRING IS NOT A PALINDROME”);
getch();
}
int stpal(char str[50])
{
int i = 0, len = 0, pal = 1;
while(str[len]!=’&#8242;)
len++;
len–;
for(i=0; i<len/2; i++)
{
if(str[i] == str[len-i])
pal = 1;
else
{
pal = 0;
break;
}
}
return pal;
}

Is This Answer Correct ?    2 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are global variables?

1170


How do you use a 'Local Block'?

1160


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

2202


Why pointers are used in c?

992


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

3096


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

1073


What is the difference between c &c++?

1129


What is a pragma?

1111


How would you obtain the current time and difference between two times?

1280


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15791


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2159


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1264


why return type of main is not necessary in linux

2090


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1203


Why do we write return 0 in c?

1040