Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pratham2 #373

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions submissions/2019/ASC.CPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
void main()
{clrscr();
int i;
char ch;
cout<<"Please put the value of a character"<<endl;
cin>>ch;
i=ch;
cout<<"The ASCII valur of the entered character is "<<i<<endl;
getch();
}
34 changes: 34 additions & 0 deletions submissions/2019/BUB_FUN.CPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<iostream.h>
#include<conio.h>
void sort(int a[],int x);
void main()

{clrscr();
int n=5,i,arr[10];
for(i=0;i<n;i++)
{cin>>arr[i];
}
sort(arr,n);
getch();
}

void sort(int a[],int x)
{int i,j,temp=0;

for(i=0;i<x;i++)
{
for(j=0;j<(x-1)-i;j++)
{ if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
for(i=0;i<x;i++)
{cout<<a[i]<<endl;
}

}

16 changes: 16 additions & 0 deletions submissions/2019/CHAR.CPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{ system("cls");
char ch;
cout<<"please press any key"<<endl;
cin>>ch;
if(ch>='A'&& ch<='Z'||ch>='a' && ch<='z')
cout<<"entered key is an alphabet "<<"i.e "<<ch<<endl;
else
if(ch>='0'&& ch<='9')
cout<<"entered key is a digit i.e "<<ch<<endl;
else
cout<<"its a special key"<<endl;
getch();}
14 changes: 14 additions & 0 deletions submissions/2019/IF_AND_E.CPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include<iostream.h>
#include<ctype.h>
#include<conio.h>
void main()
{clrscr();
int i,j;
cout<<"Please put the numbers for the comparison "<<endl;
cin>>i>>j;
if(i<'j')
{cout<<"The larger number is "<<j<<endl;}
else
{cout<<"the larger number is "<<i<<endl;}
getch();
}