Programming
[ Add ]
...
Read more »
|
This is a simple calculator using one text box and numbers. It uses the eval() function to work.
Here is the screenshot: |
This program counts time difference in minutes or hours between two different times. But unfortunately this javascript source code does not work in Google Chrome. Here is a screenshot: |
#include <iostream>
using namespace std; int mul(int x, int y){ return (x*y); } int main() { int i, j; int a[10][10]; for (i=0;i<10;i++){ for (j=0;j<10;j++) a[i][j]=mul(i,j); } for (i=0;i<10;i++){ cout<<endl; for (j=0;j<10;j++) cout<<i<<" * "<<j<<" = "<<a[i][j]<<endl; } return 0; } |
#include <cstdlib>
#include <iostream> //Gnome Sort Algorithm using namespace std; //gnomeSort Function void gnomeSort(int elements, int arr[]) { int i = 0, temp; while( i < elements ){ if ( i == 0 || arr [i - 1] <= arr[i] ) i++; else{ temp = arr[i]; arr[i] = arr[i - 1]; arr[--i] = temp; }//end else }//en ... Read more » |
#include <iostream>
using namespace std; int stugum(char c) { c&=(1<<5); if(c==0) return 0; else return 1; } int main(){ char a; cin>>a; cout<<stugum(a); return 0; } |
#include <iostream>
using namespace std; int main() { char a; cin>>a; int b=a&(1<<5); if(b==0) cout<<"upper case"; else cout<<"lower case";cin.get(); return 0; } |
#include <iostream> using namespace std; class Int{ int i; public: Int(int a){i=a;} friend int operator + (Int&, Int&); friend int operator * (Int&, Int&); friend int operator % (Int&, Int&); }; int operator + (Int& a, Int& b){return a.i*b.i-a.i;}; int operator * (Int& a, Int& b){return a.i-b.i;}; int operator % (Int& a, Int& b){return (100*b.i)/a.i;}; int main() { int x,y; cin>>x>>y; Int a(x),b(y); cout<<endl<<a*b+(a+b)<<endl<<a%b; return 0; } |
#include <iostream>
using namespace std; int main() { int i,j,n; cin>>n; for(int i=n;i>0;--i) { for(int j=i;j>0;j--) cout<<'*'; cout<<endl;} return 0; } |
#include <iostream>
using namespace std; int main() { for(int n=9, i=0; n>0, i<10; n--, i++){ cout<<n<<", "; cout<<i<<", "; } cout<<"Fire!"<<endl; return 0; } |