Showing posts with label or. Show all posts
Showing posts with label or. Show all posts
Sunday, March 1, 2015
Select All the Text in a Document or Website!
This is probably one of my favorite tips! If you want to select all of the text on a website or in a word document, this is the perfect little trick!

Let me know how you like it!
Read more »

Let me know how you like it!
Friday, February 13, 2015
Java program to check whether a given number is palindrome or not

class Palindrome
{
public static void main(String...s)
{
int n,m,rev=0,i;
n=Integer.parseInt(s[0]);
m=n;
while(n!=0)
{
i=n%10;
rev=(rev*10)+i;
n/=10;
}
if(m==rev)
System.out.println("
Number is
palindrome");
else
System.out.println("
Number is not
palindrome");
}
}
Thursday, February 12, 2015
C program to find whether a given number is an Armstrong number or not
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,m=0,x,y;
clrscr();
printf("Enter any three digit numnber:");
scanf("%d",&n);
y=n;
while(n!=0)
{
x=n%10;
m+=pow(x,3);
n=n/10;
}
if(y==m)
printf("The given number is an Armstrong number");
else
printf("The given number is not an Armstrong number");
getch();
}
Wednesday, February 11, 2015
C program to check whether given string is palindrome or not

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i,j,flag=1,len;
char str[50];
clrscr();
printf("Enter any string:");
gets(str);
len=strlen(str);
for(i=0,j=len-1;i<len/2;++i,--j)
if(str[i]!=str[j])
{
flag=0;
break;
}
if(flag)
printf("String is palindrome");
else
printf("String is not palindrome");
getch();
}
Subscribe to:
Posts (Atom)