C++ | Goodbye Duplicates
August 27, 2009 | Posted in Programming, Source Codes and Algorithms | No Comments »

|
|
C++ | Goodbye Duplicates

Exploring ZkossOh yes, its been a while since I was exploring this kind of framework. All I can say it is really “wicked, stunning and anything in between” best of all it is opensource. You can have ZK for free. Well! enough of it.
At first I find it hard to understand it especially with the file extensions [I merely don’t know what to use and when to use it]. As I read about there Userguide, I later found it out. The first thing I did was to install it. I was so confused about it, oh asking about [unknown errors] then I came to their forums and I found some answers there. Oh later on I began enjoying exploring it, and by now I can say I am beginning to be used with its environment, functionality, properties etc.
I do really believe that a student like me will have a great opportunity of learning this. Its been a week and hopefully I could start coding.
Posted by: abzkei
C++ ASCII Codes and Numeral/Alphabet/Special Characters Identifier#include<conio.h>
#include<stdio.h>
#include<iostream>
using namespace std;
main()
{
char ascii;
cout << "Give character: ";
cin >> ascii;
if((char)ascii >= 48 && (char)ascii <= 57)
{
cout<<"numerals\n";
}
else if((int)ascii >= 33 && (int)ascii <= 64)
{
cout<<"special characters\n";
}
else if((int)ascii >= 65 && (int)ascii <= 90)
{
cout<<"alphabets in capital letters\n";
}
else if((int)ascii >= 97 && (int)ascii <= 122)
{
cout<<"alphabets in small letters\n";
}
else
{
cout<<"invalid";
}
getch();
}
Posted by: abzkei

C++ | GCD - RecursionNote: Disregard the functions it is named after me. But the good thing is that it works.
#include <stdlib.h>
#include <conio.h>
#include <iostream>
using namespace std;
int abz(int ,int );
main()
{
int x,y;
cout<<"Enter 2 number for abz
: ";
cin>>x>>y;
cout<<"The Gcd <"<<x<<","<<y<<"> = " << abz(x,y)<<endl;
getch();
}
int abz(int x,int y)
{
if(y>x)
return abz(y,x);
if(x==y)
return x;
if(x%y==0)
return y;
return abz(x,x-y);
}
Posted by: abzkei
C++ | Fibonacci Series - RecursionNote: Disregard the functions it is named after me. But the good thing is that it works.
#include <stdlib.h>
#include <conio.h>
#include <iostream>
using namespace std;
int abz(int n);
main()
{
int a;
cout << "Enter any integer above 0 to find its fibonacci value:";
cin >> a;
cout << abz(a);
cout << "\n";
getch();
}
int abz(int n)
{
if ( n == 0)
{
return 0;
}
else if ( n == 1 )
{
return 1;
}
else
return abz( n -1) + abz(n-2);
}
Posted by: abzkei