Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to print palindromes between 1 to 1000 in c language

–1 vote
asked Jun 22, 2018 by nikhil

2 Answers

+2 votes
answered Jun 24, 2018 by mahendra167 (220 points)
edited Jun 24, 2018 by mahendra167
#include<stdio.h>
int main(){
   int num, rem, reverse_num, temp, start, end;

   printf("Enter the lower limit: ");
   scanf("%d",&start);

   printf("Enter the upper limit: ");
   scanf("%d",&end);

   printf("Palindrome numbers between %d and %d are: ",start,end);
   for(num=start;num<=end;num++){
      temp=num;
      reverse_num=0;
      while(temp){
         rem=temp%10;
         temp=temp/10;
         reverse_num=reverse_num*10+rem;
      }
      if(num==reverse_num)
         printf("%d ",num);
   }
   return 0;
}
commented Jun 24, 2018 by SRM 2000 (210 points)
too big , so long code is not required
+1 vote
answered Jun 24, 2018 by SRM 2000 (210 points)
#include<stdio.h>

int main()

{

int a=0;

printf("Enter the value of a :\n");

scanf("%d",&a);

if(a%2==0)

printf("The number is even.\n");

else

printf("The number is odd\n");

return 0;

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...