Answers

2015-06-06T09:11:00+05:30
class Fibnacci
{
void main()
{
int a=0,b=1,c,count=2;

System.out.print(a+",");

System.out.print(b+",");

while(count!=20)
{
c=a+b;
count++; 
System.out.print(c+",");
a=b;b=c;
}
}
}

This is my first fibnacci program so plz dont be angry If i'm wrong.

0
yes
i'll try
r u typing???
import java.util.*;
class armstrong
{
public static void main(String args[])
{
armstrong obj= new armstrong();
int i,n,sum,m;
Scanner sc=new Scanner(System.in);
System.out.print("Enter a number : ");
n=sc.nextInt();
m=obj.checknum(n);
if(n==m)
System.out.println("It is a armstrong number");
else
return (int)Math.pow(n%10,3)+ checknum(n/10);
}
}
import java.io.*;
class prime
{
public static void main(String args[])throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println(" Enter any no,");
int a = Integer.parseInt(br.readLine());
int fac=0;
for(int i =2;i{
if(a%i==0)
fac=1;
break;
}
if(fac==0)
System.out.println("Prime Number");
else
System.out.println("Not Prime Number");
}
}