Program of Fibonacci Series in C++

#include<iostream>
using namespace std;
int main()
{
int x=0,y=1,z,i,t;
cout<<"enter any number\n";
cin>>z;
cout<<x<<endl;
for(i=2;i<z;i++)
{
t=x+y;
cout<<t<<endl;
y=x;
x=t;
}
getch();
}

Programming in C++ Printing your name or string without semicolon

#include<iostream>
#include<conio.h>

using namespace std;
int main()
{
if(cout<<"mittu parmar"&&getch())
{
}
}

Programming in C++ Swapping two number without third variable

#include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"enter two numbers\n";
cin>>a;
b=a;
cin>>a;
cout<<"swap of two no. is\n"<<a<<b;
}

Programming in C++ Swapping of two Integers

#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"enter two numbers\n";
cin>>a>>b;
c=a;
a=b;
b=c;
cout<<"swap of two no. is\n"<<a<<b;
}

how to find smallest number in array in c++

how to find smallest number in array in c++

#include<iostream>
using namespace std;
main()
{
cout<<"enter 10 numbers for find smallest number from 10 numbers\n";
int a[10],i;
for(i=0;i<10;i++)
cin>>a[i];
int small=a[0];
for(i=0;i<10;i++)
if(a[i]>a[i+1])
small=a[i+1];
cout<<"smallest number is\n";
cout<<small;
}

how to cheak biggest number of array in c++

programme for cheak biggest number of array in c++


#include<iostream>
using namespace std;
main()
{
cout<<"enter 10 numbers for find biggest number from 10 numbers\n";
int a[10],i;
for(i=0;i<10;i++)
cin>>a[i];
int max=0;
for(i=0;i<10;i++)
if(a[i]>max)
max=a[i];
cout<<"biggest number is\n";
cout<<max;
}

how to print pyramid in java

//how to print pyramid in java

class Pyramid
{
    public static void main(String []args)
    {
   int i,j,k,l;
   for(i=1;i<11;i++)
       {
for(k=11;k>i;k--)
System.out.print(" ");

for(j=1;j<i;j++)
System.out.print("*");

for(l=0;l<i;l++)
System.out.print("*");

   System.out.println();
   }
    }
}


output


how to pint pyramid in c++

//programme for print pyramid in c++ 


#include<iostream>
using namespace std;
main()
{
int i,j,k,l;
for(i=1;i<11;i++)
{
for(k=11;k>i;k--)
cout<<" ";

for(j=1;j<i;j++)
cout<<"*";

for(l=0;l<i;l++)
cout<<"*";

cout<<endl;
}
}

output


programme for cheak number is prime or not in java

//programme for cheak number is prime or not in java 

class Prime
{   
    public static void main(String args[])
    {
    int n=8,i,f=0;
        
    for(i=2;i<=n;i++)
        if(n%i==0)
        {
            f=1;
            break;
        }
    if(f==1&&i==n)
        System.out.println(n+" is prime number");
    else
        System.out.println(n+" is not prime number");
    }
}

output




what is constructor
this is one of special method of any class in java
it's name will same to class name

like this-------

class Demo      ------------this is class name
{
Demo       ------------this is constrator name
{

}
}

mainly we use it for initialise variables
it can be parameterized
and it can be default

It make automatic called when we maked object of any class
when we do not maked it then java will maked it autometic

how to print odd numbers from 1 to 100 using recursion in c++

#include<iostream>
void rec(int);
void temp(int);
using namespace std;
int main()
{
int a=0;
cout<<"odd numbers from 1 to 40\n";
temp(a);
}

void rec(int a)
{
a++;
if(a%2!=0)
cout<<a<<endl;
if(a==100)
{
exit(0);
}
temp(a);
}
void temp(int a)
{
rec(a);
}

how to print odd numbers from 1 to 100 without any loop in c++

#include<iostream>
void rec(int);
void temp(int);
using namespace std;
int main()
{
int a=0;
cout<<"odd numbers from 1 to 40\n";
temp(a);
}

void rec(int a)
{
a++;
if(a%2!=0)
cout<<a<<endl;
if(a==100)
{
exit(0);
}
temp(a);
}
void temp(int a)
{
rec(a);
}

how to print evan numbers from 1 to 100 without any loop in c++

// how to print evan numbers from 1 to 100 without any loop in c++
#include<iostream>
#include<conio.h>
void rec(int);
void temp(int);
using namespace std;
int main()
{
int a=0;
cout<<"evan number from 1 to 40\n";
temp(a);
}

void rec(int a)
{
a++;
if(a%2==0)
cout<<a<<endl;
if(a==100)
{
exit(0);
}
temp(a);
}
void temp(int a)
{
rec(a);
}

how to print evan numbers from 1 to 100 using recursion in c++

// how to print evan numbers from 1 to 100 using recursion in c++
#include<iostream>
#include<conio.h>
void rec(int);
void temp(int);
using namespace std;
int main()
{
int a=0;
cout<<"evan number from 1 to 40\n";
temp(a);
}

void rec(int a)
{
a++;
if(a%2==0)
cout<<a<<endl;
if(a==100)
{
exit(0);
}
temp(a);
}
void temp(int a)
{
rec(a);
}

how Print star programme in java

public class Mittu
{
    public static void main(String args[])
    {
        for(int i=5;i>=1;i--)
            {
                for(int j=1;j<=i;j++)
                System.out.print("*");
                
                System.out.println();
            } 
    }
}

how Print star programme in java

public class Mittu
{
    public static void main(String args[])
    {
        for(int i=1;i<=5;i++)
            {
                for(int j=1;j<=i;j++)
                System.out.print("*");
                
                System.out.println();
            } 
    }
}

How to set path for java programming

1. First install java(JDK) software in your pc/laptop/desktop.
2. Go to C drive then -> Program Files then ->Java then -> jdk then      -> bin
3.copy address from top that is available on top.
4.then go to your computer properties.

5.then click on advanced system setting ->then  click environment variable



6.click on new which is near to user variable box.
7.give "path" in variable name.

8.and peste your coped in variable value.click ok.

Now your path is set. 

First programme in java print "hello world"

class First 
{
public static void main(String []args)
{
System.out.println("hello world");
}
}


Output


programme for armstrong number for 3 digit in java

armstrong number import java.util.Scanner; class Mittu {     public static void main(String []args)     {         Scanner s=new Sca...