Thursday, 11 May 2017
C++ Tutorials for begginners (hindi/urdu) [part 19] - Arrays
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
//ARRAYS
int numbers[10]={1,2,3,4,5,6,7,8,9,10};
for(int i=0;i<10;++1)
cout<<numbers[i]<<" ";
getch();
}
C++ Tutorials for begginners (hindi/urdu) [part 18]
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
// Arrays
int number[20];
number[0]=9;
number[1]=8;
number[19]=7;
cout<<number[0]<<number[1];
getch();
}
C++ Tutorials for begginners (hindi/urdu) [part 17]- nested loops
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
//nested loops
for(int i=1;i<=5;++i)
{
cout<<"value of i: "<<i<<endl;
for(int j=1;j<=5;++j)
{
cout<<"value of j: "<<j<<" ";
}
}
getch();
}
C++ Tutorials for begginners (hindi/urdu) [part 16]- do while
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
// do - while()
int i=0;
do
{
cout<<i<<endl;
i++;
}while(i<=10);
getch();
}
C++ Tutorials for begginners (hindi/urdu) [part 15]
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
int limit;
cout<<"Enter the limit"<<endl;
cin>>limit;
for(int i=0;i<=limit;++i)
{
if(i%2==0)
cout<<i<<" is even number";
else
cout<<i<<" is odd number";
}
getch();
}
C++ Tutorials for begginners (hindi/urdu) [part 14]
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
int limit;
cout<<"Enter the limit"<<endl;
cin>>limit;
for(int i=0;i<=limit;++i)
{
if(i%2==0)
cout<<i<<" is even number";
else
cout<<i<<" is odd number";
}
getch();
}
C++ Tutorials for begginners (hindi/urdu) [part 13]- for loop
#include<constream.h>
#include<iomanip.h>
void main(){
clrscr();
for(int i=0;i<=10;i++)
{
cout<<i<<endl;
}
getch();
}
Subscribe to:
Posts (Atom)