Tuesday, May 25, 2010

GOD OF WAR 2















MINIMUM REQUIREMENTS Operating System: Windows XP / Vista Processor: with a frequency of 2.5 GHz that supports SSE3 Memory: 1 GB Video Card: GeForce 6800 class, ATI X1300 or better Free space: 7 GB Sound: DirectX 9.0c compatible sound card Controls: keyboard mouse (better gamepad)
Weight: 7.7 GB 77 x 100 Mb
How to install game 1) Mount image through Daemon Tools or Alcohol 120% 2) Install game 3) Running from the desktop 4) Play!
To change the language of the game God Of War 2 Full Free Download
a) Any editing pcsx2.ini (located within the inis folder) and search and switch to Language Language = 0 (only proceed to the second way, if this does not work) or Another thing: If the Russian language in the statement God.Of.War.2.For.PC p2p-FLTeam only in the PCSX2 emulator, that can be changed within the emulator.
1. PCSX2 saves usermode.ini in: C: Documents and Settings (Your user name) Local Settings Application Data pcsx2
2. Normally the folder settings "inis" can be found on PCSX2 is This is also written in usermode.ini, so may want to check that the settings are.
There are two ways to change the language of the emulator PCSX2:
a) Any editing pcsx2.ini (located within the inis folder) and search and switch to Language Language = 0 (only proceed to the second way, if this does not work) or b) Delete all the languages of the Lang folder (the first form if you will).









Descargar desde Rapishare el juego:

http://rapidshare.com/files/375376691/God-Of-War-2-KTU.part01.rar
http://rapidshare.com/files/375382705/God-Of-War-2-KTU.part02.rar
http://rapidshare.com/files/375378750/God-Of-War-2-KTU.part03.rar
http://rapidshare.com/files/375396464/God-Of-War-2-KTU.part04.rar
http://rapidshare.com/files/375377118/God-Of-War-2-KTU.part05.rar
http://rapidshare.com/files/375371920/God-Of-War-2-KTU.part06.rar
http://rapidshare.com/files/375384686/God-Of-War-2-KTU.part07.rar
http://rapidshare.com/files/375388425/God-Of-War-2-KTU.part08.rar
http://rapidshare.com/files/375373659/God-Of-War-2-KTU.part09.rar
http://rapidshare.com/files/375385160/God-Of-War-2-KTU.part10.rar
http://rapidshare.com/files/375382930/God-Of-War-2-KTU.part11.rar
http://rapidshare.com/files/375385461/God-Of-War-2-KTU.part12.rar
http://rapidshare.com/files/375377673/God-Of-War-2-KTU.part13.rar
http://rapidshare.com/files/375381281/God-Of-War-2-KTU.part14.rar
http://rapidshare.com/files/375371728/God-Of-War-2-KTU.part15.rar
http://rapidshare.com/files/375390816/God-Of-War-2-KTU.part16.rar
http://rapidshare.com/files/375393476/God-Of-War-2-KTU.part17.rar
http://rapidshare.com/files/375376574/God-Of-War-2-KTU.part18.rar
http://rapidshare.com/files/375387317/God-Of-War-2-KTU.part19.rar
http://rapidshare.com/files/375378334/God-Of-War-2-KTU.part20.rar
http://rapidshare.com/files/375392411/God-Of-War-2-KTU.part21.rar
http://rapidshare.com/files/375373644/God-Of-War-2-KTU.part22.rar
http://rapidshare.com/files/375381579/God-Of-War-2-KTU.part23.rar
http://rapidshare.com/files/375383584/God-Of-War-2-KTU.part24.rar
http://rapidshare.com/files/375385279/God-Of-War-2-KTU.part25.rar
http://rapidshare.com/files/375371545/God-Of-War-2-KTU.part26.rar
http://rapidshare.com/files/375396739/God-Of-War-2-KTU.part27.rar
http://rapidshare.com/files/375396101/God-Of-War-2-KTU.part28.rar
http://rapidshare.com/files/375397348/God-Of-War-2-KTU.part29.rar
http://rapidshare.com/files/375379545/God-Of-War-2-KTU.part30.rar
http://rapidshare.com/files/375391951/God-Of-War-2-KTU.part31.rar
http://rapidshare.com/files/375381782/God-Of-War-2-KTU.part32.rar
http://rapidshare.com/files/375394360/God-Of-War-2-KTU.part33.rar
http://rapidshare.com/files/375374012/God-Of-War-2-KTU.part34.rar
http://rapidshare.com/files/375392776/God-Of-War-2-KTU.part35.rar
http://rapidshare.com/files/375387212/God-Of-War-2-KTU.part36.rar
http://rapidshare.com/files/375383892/God-Of-War-2-KTU.part37.rar
http://rapidshare.com/files/375387088/God-Of-War-2-KTU.part38.rar
http://rapidshare.com/files/375383190/God-Of-War-2-KTU.part39.rar
http://rapidshare.com/files/375371590/God-Of-War-2-KTU.part40.rar
http://rapidshare.com/files/375380629/God-Of-War-2-KTU.part41.rar
http://rapidshare.com/files/375390151/God-Of-War-2-KTU.part42.rar
http://rapidshare.com/files/375375371/God-Of-War-2-KTU.part43.rar
http://rapidshare.com/files/375394095/God-Of-War-2-KTU.part44.rar
http://rapidshare.com/files/375387750/God-Of-War-2-KTU.part45.rar
http://rapidshare.com/files/375379307/God-Of-War-2-KTU.part46.rar
http://rapidshare.com/files/375382092/God-Of-War-2-KTU.part47.rar
http://rapidshare.com/files/375380098/God-Of-War-2-KTU.part48.rar
http://rapidshare.com/files/375375079/God-Of-War-2-KTU.part49.rar
http://rapidshare.com/files/375394982/God-Of-War-2-KTU.part50.rar
http://rapidshare.com/files/375389948/God-Of-War-2-KTU.part51.rar
http://rapidshare.com/files/375395419/God-Of-War-2-KTU.part52.rar
http://rapidshare.com/files/375379781/God-Of-War-2-KTU.part53.rar
http://rapidshare.com/files/375394353/God-Of-War-2-KTU.part54.rar
http://rapidshare.com/files/375388836/God-Of-War-2-KTU.part55.rar
http://rapidshare.com/files/375383113/God-Of-War-2-KTU.part56.rar
http://rapidshare.com/files/375390772/God-Of-War-2-KTU.part57.rar
http://rapidshare.com/files/375391647/God-Of-War-2-KTU.part58.rar
http://rapidshare.com/files/375393258/God-Of-War-2-KTU.part59.rar
http://rapidshare.com/files/375376006/God-Of-War-2-KTU.part60.rar
http://rapidshare.com/files/375389096/God-Of-War-2-KTU.part61.rar
http://rapidshare.com/files/375384603/God-Of-War-2-KTU.part62.rar
http://rapidshare.com/files/375386297/God-Of-War-2-KTU.part63.rar
http://rapidshare.com/files/375375253/God-Of-War-2-KTU.part64.rar
http://rapidshare.com/files/375373273/God-Of-War-2-KTU.part65.rar
http://rapidshare.com/files/375373568/God-Of-War-2-KTU.part66.rar
http://rapidshare.com/files/375375776/God-Of-War-2-KTU.part67.rar
http://rapidshare.com/files/375390836/God-Of-War-2-KTU.part68.rar
http://rapidshare.com/files/375392487/God-Of-War-2-KTU.part69.rar
http://rapidshare.com/files/375378451/God-Of-War-2-KTU.part70.rar
http://rapidshare.com/files/375389211/God-Of-War-2-KTU.part71.rar
http://rapidshare.com/files/375371622/God-Of-War-2-KTU.part72.rar
http://rapidshare.com/files/375395946/God-Of-War-2-KTU.part73.rar
http://rapidshare.com/files/375381107/God-Of-War-2-KTU.part74.rar
http://rapidshare.com/files/375386814/God-Of-War-2-KTU.part75.rar
http://rapidshare.com/files/375376667/God-Of-War-2-KTU.part76.rar
http://rapidshare.com/files/375383616/God-Of-War-2-KTU.part77.rar

Descargar desde megaupload el juego:

http://www.megaupload.com/?d=TBA7KN6N
http://www.megaupload.com/?d=CS4ZDCOE
http://www.megaupload.com/?d=XQEK8J6V
http://www.megaupload.com/?d=IM094ISZ
http://www.megaupload.com/?d=OCLP8868
http://www.megaupload.com/?d=75V141IC
http://www.megaupload.com/?d=R90BOSI1
http://www.megaupload.com/?d=9ZV2C56O
http://www.megaupload.com/?d=7KRURRJM
http://www.megaupload.com/?d=71MNEC7U
http://www.megaupload.com/?d=FXD455WC
http://www.megaupload.com/?d=4TW6UF1F
http://www.megaupload.com/?d=7OYV1P8N
http://www.megaupload.com/?d=AVA0KKWH
http://www.megaupload.com/?d=4VO49VNP
http://www.megaupload.com/?d=80KVUPZ3
http://www.megaupload.com/?d=SRO49EKN
http://www.megaupload.com/?d=VTZKBJHE
http://www.megaupload.com/?d=6C6CDD0Y
http://www.megaupload.com/?d=BC6FNH8N
http://www.megaupload.com/?d=S0N63C37
http://www.megaupload.com/?d=0ZV2Z5FU
http://www.megaupload.com/?d=LL03MMSG
http://www.megaupload.com/?d=85MNU2DB
http://www.megaupload.com/?d=P6YCEFO1
http://www.megaupload.com/?d=G8Y4WZ0T
http://www.megaupload.com/?d=3L148KPV
http://www.megaupload.com/?d=M3CVTT1A
http://www.megaupload.com/?d=HC25FY4G
http://www.megaupload.com/?d=0Q1AC32O
http://www.megaupload.com/?d=CKMKTLO6
http://www.megaupload.com/?d=JJ4DGVR7
http://www.megaupload.com/?d=P5VPCBSE
http://www.megaupload.com/?d=EVHTSJHM
http://www.megaupload.com/?d=ZSN5DH31
http://www.megaupload.com/?d=P06Z9H56
http://www.megaupload.com/?d=VX0KOK8N
http://www.megaupload.com/?d=Z36VB66T
http://www.megaupload.com/?d=CFQ476GP
http://www.megaupload.com/?d=Q8IQ5B01
http://www.megaupload.com/?d=81HL5NR2
http://www.megaupload.com/?d=BG95Z6X9
http://www.megaupload.com/?d=60ZQUCTY
http://www.megaupload.com/?d=LNORK1K3
http://www.megaupload.com/?d=BV1QX5HD
http://www.megaupload.com/?d=7P8TIRO6
http://www.megaupload.com/?d=F60B0BQ0
http://www.megaupload.com/?d=PUIPW80Z
http://www.megaupload.com/?d=TMQA5TD9
http://www.megaupload.com/?d=W9IA3RV9
http://www.megaupload.com/?d=2OJXZQ6J
http://www.megaupload.com/?d=P71J0U4C
http://www.megaupload.com/?d=CA98WUE6
http://www.megaupload.com/?d=7JA03GPE
http://www.megaupload.com/?d=MDE36U39
http://www.megaupload.com/?d=H4RWX582
http://www.megaupload.com/?d=NKBZB8D6
http://www.megaupload.com/?d=99QASRBW
http://www.megaupload.com/?d=OB313T7V
http://www.megaupload.com/?d=Z4Y9IL99
http://www.megaupload.com/?d=QS8Y2PZ5
http://www.megaupload.com/?d=E7JW5DZT
http://www.megaupload.com/?d=8F9VZ02N
http://www.megaupload.com/?d=CSPBHAAG
http://www.megaupload.com/?d=UHJUJ02Z
http://www.megaupload.com/?d=R8H6FIAM
http://www.megaupload.com/?d=6T32VUXB
http://www.megaupload.com/?d=5WC7032U
http://www.megaupload.com/?d=63TTLR7G
http://www.megaupload.com/?d=I7Z2NWXH
http://www.megaupload.com/?d=HAPRHNS0
http://www.megaupload.com/?d=NP917SI8
http://www.megaupload.com/?d=5596FJO3
http://www.megaupload.com/?d=ZWTXRJCV
http://www.megaupload.com/?d=BA24I6Q1
http://www.megaupload.com/?d=XP44CTLU
http://www.megaupload.com/?d=76VX88JF


Descargar desde mediafire el juego:

http://www.mediafire.com/file/g51hwodooui
http://www.mediafire.com/file/3gddjwgk4yn
http://www.mediafire.com/file/nzm1zjght2j
http://www.mediafire.com/file/dnz4xyc1gyt
http://www.mediafire.com/file/3j3jynmk2n1
http://www.mediafire.com/file/wjtzlzq5yki
http://www.mediafire.com/file/wltodmymyy3
http://www.mediafire.com/file/zm4zjyo5nyd
http://www.mediafire.com/file/omylhoiz3jt
http://www.mediafire.com/file/3nondiiwwtz
http://www.mediafire.com/file/nyyj0yxkfmd
http://www.mediafire.com/file/5mukkzym0h5
http://www.mediafire.com/file/z3dznzzknae
http://www.mediafire.com/file/zmzgyim2mdy
http://www.mediafire.com/file/zeotmwyynzd
http://www.mediafire.com/file/m55mynzz33g
http://www.mediafire.com/file/inngnmkgrng
http://www.mediafire.com/file/tna4o2mln2m
http://www.mediafire.com/file/ntmeqzlny2n
http://www.mediafire.com/file/tqmycx0d2nx
http://www.mediafire.com/file/5jy5wtzn3xy
http://www.mediafire.com/file/ez1juyuvouy
http://www.mediafire.com/file/yod2dzgdmmy
http://www.mediafire.com/file/21tfeyomnkg
http://www.mediafire.com/file/2r0uzkmyx3y
http://www.mediafire.com/file/jywyqmz4tnz
http://www.mediafire.com/file/ywmydgij2nj
http://www.mediafire.com/file/3dvmzjj4nug
http://www.mediafire.com/file/dg2fq2zqjdb
http://www.mediafire.com/file/jzxwmh1yad1
http://www.mediafire.com/file/zwoyme2zigz
http://www.mediafire.com/file/nooizzwiwxt
http://www.mediafire.com/file/yldvmywykyz
http://www.mediafire.com/file/bmernm4jmyn
http://www.mediafire.com/file/2nymqzzw3nc
http://www.mediafire.com/file/2tw5znmtnz1
http://www.mediafire.com/file/mnuklhn4iwm
http://www.mediafire.com/file/wkznmzojqam
http://www.mediafire.com/file/nnwoknmmn2z
http://www.mediafire.com/file/eymdg5im2l5
http://www.mediafire.com/file/nmbjzdmtjnm
http://www.mediafire.com/file/vwzgtmnyjym
http://www.mediafire.com/file/wudzmyreyq4
http://www.mediafire.com/file/aji4iekyumi
http://www.mediafire.com/file/zmy1yzjmbu3
http://www.mediafire.com/file/tguigyn4xnt
http://www.mediafire.com/file/wzwdj4gtlz2
http://www.mediafire.com/file/jthjdywgkzz
http://www.mediafire.com/file/l4mnqumnnnw
http://www.mediafire.com/file/yg5z0nwjjjz
http://www.mediafire.com/file/oyfzjm2whww
http://www.mediafire.com/file/rijmzimaoxb
http://www.mediafire.com/file/y3zfy2mn0yw
http://www.mediafire.com/file/zjeehgmmjen
http://www.mediafire.com/file/mtnnmwtjxyh
http://www.mediafire.com/file/jjmiymzodyy
http://www.mediafire.com/file/2yyqimzh2lm
http://www.mediafire.com/file/zwnmtkmwxmm
http://www.mediafire.com/file/kizmongmneq
http://www.mediafire.com/file/jwmxnu2vzym
http://www.mediafire.com/file/zn32vfmhkkw
http://www.mediafire.com/file/g1y5ge4nqyy
http://www.mediafire.com/file/muvon0zmmwz
http://www.mediafire.com/file/jdyu4ezmy2k
http://www.mediafire.com/file/mmyxzwggntz
http://www.mediafire.com/file/jlgiywzl1m0
http://www.mediafire.com/file/dgzwzmtmzmi
http://www.mediafire.com/file/mhwjmzyzmzz
http://www.mediafire.com/file/dtjwivw4mmz
http://www.mediafire.com/file/nzlugotqnmj
http://www.mediafire.com/file/k13ytyyjn1j
http://www.mediafire.com/file/tm3yozjzxzj
http://www.mediafire.com/file/gyzzenmyojz
http://www.mediafire.com/file/nioilknyzmg
http://www.mediafire.com/file/mtin5zwiy5m
http://www.mediafire.com/file/jnngul1nr4z

PROGRAMME FOR LOOP

/*WIRTE A PROGRAM TO ACCEPT A NUMBER AND FIND SUM OF ITS INDIVIDUAL DIGITS REPEATEDLY TILL THE RESULT IS SINGLE DIGIT./*

#include
#include
#include
void main()
{
int n,s=0;
clrscr();
printf("\n\tEnter a Number:");
scanf("%d",&n);
printf("\n\tSum of Digits till a single digit\n\t%d",n);
for(;n!=0;)
{
s=s+n%10;
n=n/10;
if(n==0&&s>9)
{
printf("\n\t %2d",s);
n=s;
s=0;
}
}
printf("\n\t %2d",s);
getch();
}

C PROGRAMME FOR STRUCTURE

/*WRITE A PROGRAM USING STRUCTURES TO DISPLAY THE FOLLOWING INFORMATION FOR EACH CUSTOMER NAME, ACCOUNT NUMBER,STREET,CITY,OLD BALANCE,CURRENT PAYMENT, NEW BALANCE, ACCOUNT STATUS.*/

#include
#include
struct customer{
char name[30];
int account_no;
char street[20];
char city[20];
float old_bal;
float curr_payment;
float new_bal;
char acc_status[20];
};
int main(){
struct customer customers[2];
int i;
clrscr();
printf("Enter details of");
for(i=0;i<2;i++){
printf("\n customer %d:\n",i);
printf("\tName :");
scanf("%s", &customers[i].name);
printf("\tAccount No :");
scanf("%d", &customers[i]. account_no);
printf("\tAddress : a>street b>city");
scanf("%s %s",&customers[i].street,&customers[i].city);
printf("\tOld Balance:");
scanf("%f",&customers[i].old_bal);
printf("\tcurrent payment:");
scanf("%f",&customers[i].curr_payment);
printf("\tAccount Status:");
scanf("%s",customers[i].acc_status);
}
printf("\n\n-------------------------------------------------------------------\n");
for(i=0;i<2;i++){
printf("Customer %d details::\n",i);
printf("Name : %s", customers[i].name);
printf("Account No: %d\n", customers[i].account_no);
printf("Address : a>street: %s b>city: %s\n",customers[i].street, customers[i].city);
printf("Old Balance: %f\n", customers[i].old_bal);
printf("Current Payment :%f\n", customers[i].curr_payment);
printf("New balance:%f\n",(customers[i].old_bal-customers[i].curr_payment));
printf("Account Status: %s\n",customers[i].acc_status);
}
getch();
return 0;
}

Saturday, March 6, 2010

NUMBERS DIVIDED BY 7

WAP to print numbers from 1-50 which are divided by 7
void main ()
{
int a;
clrscr ();
a=1;
while (a<=50)
{
if (a%7==0)
printf ("%d\n",a);
a++;
}
getch ();
}

ODD SERIES

WAP to print Odd numbers from 1 to 20
void main ()
{
int a;
clrscr ();
a=1;
while (a<=20)
{
if (a%2==1)
printf ("\n%d",a);
a++;
}
getch ();
}

SQUARE & CUBE

WAP to print series from 1 to 10 & find its square and cube

void main ()
{
int a=1,sqr=0,cube=0;
clrscr ();
while (a<=10)
{
sqr=pow(a,2);
cube=pow(a,3);
printf ("%d\t %d\t %d\n",a,sqr,cube);
a++;
}
getch ();
}

SKIP 5 & 7

WAP to print series from 1 to 10 and skip 5 & 7

void main ()
{
int a;
clrscr ();
for (a=1;a<=10;a++)
{
if (a==5 || a==7)
continue;
printf ("%d\n",a);
}
getch ();
}

SERIES 20 TO 1

WAP to print series from 20 to 1
#include
void main ()
{
int a;
clrscr ();
a=20;
while (a>=1)
{
printf ("\n%d",a);
a--;
}
getch ();
}

PRINT SERIES (VARIABLE)

WAP to print series from start to end using do-while loop
void main ()
{
int a,b;
clrscr ();
printf ("Enter Start: ");
scanf ("%d",&a);
printf ("Enter End: ");
scanf ("%d",&b);
do
{
printf ("%d\n",a);
a++;
}
while (a<=b);
getch ();
}

PRINT STARS

WAP to print Stars on screen
void main ()
{
int i,j;
clrscr();
for (j=1;j<4;j++)
{
for (i=1;i<=5;i++)
{
printf ("*");
}
printf ("\n");
}
getch ();
}

TABLE OF 5

WAP to print table of 5

void main ()
{
int a,tab;
clrscr ();
a=1,tab=0;
while (a<=10)
{
tab=5*a;
a++;
printf ("%d\n",tab);
}
getch ();
}

PASSWORD VERIFICATION

WAP to print the detail of the programmer
if the given number is 464
void main ()
{
int pass;
clrscr();
do
{
printf ("Enter Password to see the detail of programmer:\n");
scanf ("%d",&pass);
}
while (pass!=464);
printf ("\nJagjeet Singh");
printf ("\nB.Sc. (I.T.)\nPunjab Technical University");
getch ();
}

VALUE OF DATA TYPE

WAP to print value of multiple data types
#include
#include
void main ()
{
int a=10;
float d=40.50;
char ch='A';
double dbl=78.9786;
long lng=7897711;
char nm [10]="JIMMY";
clrscr ();
printf ("\nInteger value is %d",a);
printf ("\nFloat value is %.2f",d);
printf ("\nCharacter value is %c",ch);
printf ("\nDouble value is %.4lf",dbl);
printf ("\nLong value is %ld",lng);
printf ("\nString value is %s",nm);
getch ();
}

SUM,SUB,PRODUCT,DIVISION

WAP to Sum, Subtract, Multiply & Division of two numbers (5 Variables)

#include

void main ()
{
int a,b,c,d,e,f;
clrscr();
printf ("Enter A: ");
scanf ("%d",&a);
printf ("Enter B: ");
scanf ("%d",&b);
c=a+b;
d=a-b;
e=a*b;
f=a/b;
printf ("\nSum is : %d",c);
printf ("\nSubtraction is : %d",d);
printf ("\nMultiplication is : %d",e);
printf ("\nDivision is : %d",f);
getch ();
}

SUM OF ARRAY

WAP to sum of five elements of an array
void main ()
{
int no[5],i,sum;
clrscr ();
for (i=0;i<=4;i++)
{
printf ("Enter Element: ");
scanf ("%d",&no[i]);
}
sum=no[0]+no[1]+no[2]+no[3]+no[4];
printf ("\nSum of five Elements: %d",sum);
getch ();
}

SWAP NUMBERS

SWAP NUMBERS

WAP to SWAP the three digit number
void main ()
{
int b,r,n,r1,r2;
clrscr ();
printf ("Enter the Value: ");
scanf ("%d",&n);
r=n%10;
n=n/10;
r1=n%10;
n=n/10;
r2=n%10;
n=n/10;
b=(r*100)*(r2*10)+(r2);
printf ("%d%d%d",r,r1,r2);
getch ();
}



 

 

 

FIND THE SUM OF DIGIT THREE Numbers

FIND THE SUM OF DIGIT THREE Numbers

 

/* FIND THE SUM OF DIGIT THREE NO'S*/
#include "math.h"
main()
{
int d,d1,d2,d3,r1,r2,sum;
clrscr();
printf("\n enter any three digit no's");
scanf("%d",&d);
d1=d/100;
r1=d%100;
if(r1!=0)
{
d2=r1/10;
r2=r1%10;
if(r2!=0)
d3=r2;
else
d3=0;
}
else
d2=0;
d3=0;
}
sum=d1+d2+d3;
printf("\n sum of 3 digit no is %d",sum);
getch();
}

Factorial Function In C

Factorial Function In C

#include "stdio.h"
#include "conio.h"
long int factorial(int n);
void main()
{
int n,i;
float s,r;
char c;
clrscr();
repeat : printf("You have this series:- 1/1! + 2/2! + 3/3! + 4/4!");
printf("To which term you want its sum? ");
scanf("%d",&n);
s=0;
for (i=1;i<=n;i++)
{
s=s+((float)i/(float)factorial(i));
}
printf("The sum of %d terms is %f",n,s);
fflush(stdin);
printf ("Do you want to continue?(y/n):- ");
scanf("%c",&c);
if (c=='y')
goto repeat;
getch();
}

long int factorial(int n)
{
if (n<=1)
return(1);
else
n=n*factorial(n-1);
return(n);
}

Basic example showing constants usage in C

#include
/*constants for bonus rates and sales*/
#define BONUSRATE1 0.1
#define BONUSRATE2 0.15
#define BONUSRATE3 0.2
#define SALES1 2000
#define SALES2 5000
#define SALES3 10000
int main()
{
int sales;
double commission;
/*get employees sales*/
printf("Please enter your total sales to the nearest dollar.\n");
scanf("%d", &sales);
/*calculate employees bonus based on info*/
if(sales <=2000)
{
commission = sales * BONUSRATE1;
printf("%g\n" , commission);
}
else if(sales > 2000 && sales <=5000)
{
commission = sales * BONUSRATE2;
printf("%g\n" , commission);
}
else
{
commission = sales * BONUSRATE3;
printf("%g\n" , commission);
}

return 0;
}

calculate the power in watts

#include
int main()
{
float power,voltage,current;
voltage = current = 0;

printf("Power calculator.\n");
printf("This will calculate the power in watts , ");
printf("when you input the voltage and current.");
/*get the voltage*/
printf("Enter the voltage in volts.\n");
scanf("%f",&voltage);
/*get the current*/
printf("Enter the current in amps.\n");
scanf("%f",&current);
/*calculate the power*/
power = voltage * current;
printf("The power in watts is %.2f watts\n",power);

return 0;
}

Progam that gives length of side of a Triangle

//Progam that gives all details of a Triangle given the lengths of its sides
#include
#include
#include
#include

main()
{
clrscr();
float a,b,c,S,D,A,B,C,Area,R;
printf("Enter the lengths of the three sides of the triangle :");
scanf("%f%f%f",&a,&b,&c);

S = (a+b+c)/2.0; // S is the semiperimeter of the triangle
D = S*(S-a)*(S-b)*(S-c);//D is the square of the area of the triangle
if(D<=0)
{
printf("The triangle cannot be formed");
getch();
exit(0);
}

if((a==b || b==c || c==a) && !(a==b && b==c && c==a))
// this complex logic is to eliminate interpretting a triangle with all
three
// sides equal as both isosceles and equilateral.
printf("The triangle is ISOSCELES");
if(a==b && b==c && c==a)
printf("The triangle is EQUILATERAL Type");
if(a!=b && b!=c && c!=a)
printf("The triangle is SCALENE");

Area = sqrt(D);
R = (a*b*c)/(4.0*Area);
printf("PERIMETER = %.2f units",(2.0*S));
printf("AREA = %.2f sq.units",Area);
printf("CIRCUM RADIUS = %.2f units",R);
// using sine rule,we get...
A = (180.0/3.1415926)*asin(a/(2.0*R));// value of pi should be upto 7
B = (180.0/3.1415926)*asin(b/(2.0*R));// decimal places of accuracy and
also
C = (180.0/3.1415926)*asin(c/(2.0*R));// note that the 7th decimal place
// 6 and not 7 as it had to be if were
if(A==90.0 || B==90.0 || C==90.0)
// approximated to 7 decimalplaces
printf("The triangle is RIGHT ANGLED");
if(A<90.0 && B<90.0 && C<90.0)
printf("The triangle is ACUTE ANGLED");
if(A>90.0 || B>90.0 || C>90.0)
printf("The triangle is OBTUSE ANGLED");

printf("The angles are as follows :");
printf("A = %.2f degrees",A);
printf("B = %.2f degrees",B);
printf("C = %.2f degrees",C);
printf("Where A,B,C stand for angles opposite to sides%.2f,%.2f,%.2f",a,b,c);
printf(" respectively");


getch();
return 0;
}

Ohms law example In C

#include
#include
#include
int main()
{
char ch;
float voltage , current , resistance , result;
printf("Ohms law calculator.\n");
printf("Please choose from following calculcations.\n");
printf("1. choose 1 to calculate the voltage.\n");
printf("2. choose 2 to calculate the current.\n");
printf("3. choose 3 to calculate the resistance.\n");
printf("Anything else to quit.\n");
scanf("%c",&ch);
switch(ch)
{
case '1' :
printf("please enter the current in amps.\n");
scanf("%f",&current);
printf("Now enter the resistance in ohms.\n");
scanf("%f",&resistance);
result = current * resistance;
printf("The voltage is %0.2f volts.\n",result);
break;
case '2' :
printf("please enter the voltage in volts.\n");
scanf("%f",&voltage);
printf("Now enter the resistance in ohms.\n");
scanf("%f",&resistance);
result = voltage / resistance;
printf("The current is %0.2f amps.\n",result);
break;
case '3' :
printf("please enter the voltage in volts.\n");
scanf("%f",&voltage);
printf("Now enter the current in amps.\n");
scanf("%f",&current);
result = voltage / current;
printf("The resistance is %0.2f ohms.\n",result);
break;
default :
exit(0);
break;
}
return 0;
}

Print a double pyramid

void main(void)
{
clrscr();
int i,j,k,l,b,n;
printf("Enter the value of N:");
scanf("%d",&n);
for(i=0;i
{
printf("");
for(l=0;l
printf(" ");
for(j=i+1;j<=n;j++)
printf("%d",j);
for(k=n-1;k>i;k--)
printf("%d",k);
}
b=n-1;
for(i=0;i
{
printf("");
for(l=n-2;l>i;l--)
printf(" ");
for(j=b;j<=n;j++)
printf("%d",j);
for(k=n-1;k>=b;k--)
printf("%d",k);
b--;
}
getch();
}
AddThis

Friday, March 5, 2010

C Program to calcuate interest and total amount at the end of each year

Write a

c program

calculate interest and total amount at da end of each year

Note: Output is not in the form of table and rate is taken as 2%. It calculates amount of each year



#include <>
#include <>
void main()
{
int t=1;
int r=2;
int y;
int y1=0;
long int p,a;
float i1;
double total;;
clrscr();
printf("enter starting amount&year");
scanf("%ld""%d",&p,&y);
while(y1<2009)
{
printf("enter current year");
scanf("%d",&y1);
printf("enter amount to be deposited");
scanf("%ld",&a);
i1=(p*r*t)/100;
total=i1+a+p;
printf("1%d",y);
printf("starting amount is %ld",p);
p=p+a;
printf("current year is %d",y1);
printf("interest is %f",i1);
printf("total amount is %lf",total);
}
getch();
}

REVERSE NUMBER

WAP to Reverse of any number using while loop
void main ()
{
int no,r,res;
clrscr ();
printf ("Enter any value: ");
scanf ("%d",&no);
r=res=0;
while (no>0)
{
r=no%10;
no=no/10;
res=(res*10)+r;
}
printf ("\nReverse is %d",res);
getch ();
}

Program for conversion of Decimal to Roman Number

#include

main()
{
int a,b,c,d,e;
clrscr();
printf("Input a number (between 1-3000):");
scanf("%d",&e);
while (e==0||e>3000)
{
printf ("ERROR: Invalid Input!");
printf ("Enter the number again:");
scanf ("%d",&e);
}
if (e>3000)
printf("Invalid");
a = (e/1000)*1000;
b = ((e/100)%10)*100;
c = ((e/10)%10)*10;
d = ((e/1)%10)*1;

if (a ==1000)
printf("M");
else if (a ==2000)
printf("MM");
else if (a ==3000)
printf("MMM");

if (b == 100)
printf("C");
else if (b == 200)
printf("CC");
else if (b == 300)
printf("CCC");
else if (b == 400)
printf("CD");
else if (b ==500)
printf("D");
else if (b == 600)
printf("DC");
else if (b == 700)
printf("DCC");
else if (b ==800)
printf("DCCC");
else if (b == 900)
printf("CM");


if (c == 10)
printf("X");
else if (c == 20)
printf("XX");
else if (c == 30)
printf("XXX");
else if (c == 40)
printf("XL");
else if (c ==50)
printf("L");
else if (c == 60)
printf("LX");
else if (c == 70)
printf("LXX");
else if (c ==80)
printf("LXXX");
else if (c == 90)
printf("XC");

if (d == 1)
printf("I");
else if (d == 2)
printf("II");
else if (d == 3)
printf("III");
else if (d == 4)
printf("IV");
else if (d ==5)
printf("V");
else if (d == 6)
printf("VI");
else if (d == 7)
printf("VII");
else if (d ==8)
printf("VIII");
else if (d == 9)
printf("IX");
getch();
}

Matrix Multiplication

void main()
{
int row1=0,
col1=1,
row2=0,
col2=0,
**matrix1,
**matrix2,
**result;

clrscr();
printf(" Enter number of row for first matrix ");
scanf("%d",&row1);

while (col1!=row2)
{
printf(" Enter number of column for first matrix ");
scanf("%d",&col1);

printf(" Enter number of row for second matrix ");
scanf("%d",&row2);

if (col1!=row2)
{
clrscr();
printf("Column number of first matrix must be same as the row number of second matrix");
}


}


printf(" Enter number of column for second matrix ");
scanf("%d",&col2);

matrix1=init(matrix1,row1,col1);
matrix2=init(matrix2,row2,col2);
/* setting values in matrix */
printf("First matrix \n");
set(matrix1,row1,col1);
printf("Second matrix \n");
set(matrix2,row2,col2);
/* printint matrix */
clrscr();
printf(" [ First matrix ]\n");
get(matrix1,row1,col1);
printf(" [ Second matrix ]\n");
get(matrix2,row2,col2);

printf(" [ Multiplication Result ]\n");
result=mul(matrix1,matrix2,row1,col2,col1);
get(result,row1,col2);
printf("\n\t\t Thanks from debmalya jash");
getch();
free(matrix1);
free(matrix2);
fress(result);


} /* end main */


/* to initialize matrix */
int** init(int** arr,int row,int col)
{
int i=0,
j=0;

arr=(int**)malloc(sizeof(int)*row*col);

for(i=0;i
{
for(j=0;j
{
*((arr+i)+j)=(int*)malloc(sizeof(int));
*(*(arr+i)+j)=0;
}
}
return arr;
}

/* to set value in matrix */
int** set(int** arr,int row,int col)
{
int i=0,
j=0,
val=0;

for(i=0;i
{
for(j=0;j
{
printf("Enter value for row %d col %d :",(i+1),(j+1));
scanf("%d",&val);
*(*(arr+i)+j)=val;
}
}
return arr;
}


/* print values of the passed matrix */
void get(int** arr,int row,int col)
{
int i=0,
j=0;

for(i=0;i
{
for(j=0;j
{
printf("%d\t",*(*(arr+i)+j));
}
printf("\n");
}
}

/* mutiply two matrices and return the resultant matrix */
int** mul(int** arr1,int** arr2,int row,int col,int col1)
{
int **result,
i=0,
j=0,
k=0;

result=init(result,row,col);

for(i=0;i
{
for(j=0;j
{
for(k=0;k
{
printf("%dX%d(%d)",*(*(arr1+i)+k),*(*(arr2+k)+j),(*(*(arr1+i)+k))*(*(*(arr2+k)+j)));
*(*(result+i)+j)+=(*(*(arr1+i)+k))*(*(*(arr2+k)+j));

if (k!=(col1-1))
printf("+");
}
printf("\t");
}
printf("\n");
}
return result;

2d example insertion sort

#include stdio.h
#include stdlib.h

struct node
{
int number;
struct node *next;
};

struct node *head = NULL;

/* insert a node directly at the right place in the linked list */
void insert_node(int value);

int main(void)
{
struct node *current = NULL;
struct node *next = NULL;
int test[] = {8, 3, 2, 6, 1, 5, 4, 7, 9, 0};
int i = 0;

/* insert some numbers into the linked list */
for(i = 0; i < 10; i++)
insert_node(test[i]);

/* print the list */
printf(" before after\n"), i = 0;
while(head->next != NULL)
{
printf("%4d\t%4d\n", test[i++], head->number);
head = head->next;
}

/* free the list */
for(current = head; current != NULL; current = next)
next = current->next, free(current);

return 0;
}

void insert_node(int value)
{
struct node *temp = NULL;
struct node *one = NULL;
struct node *two = NULL;

if(head == NULL) {
head = (struct node *)malloc(sizeof(struct node *));
head->next = NULL;
}

one = head;
two = head->next;

temp = (struct node *)malloc(sizeof(struct node *));
temp->number = value;

while(two != NULL && temp->number < two->number) {
one = one->next;
two = two->next;
}

one->next = temp;
temp->next = two;
}

c programme

Write a

c program

calculate interest and total amount at da end of each year

Note: Output is not in the form of table and rate is taken as 2%. It calculates amount of each year



#include <>
#include <>
void main()
{
int t=1;
int r=2;
int y;
int y1=0;
long int p,a;
float i1;
double total;;
clrscr();
printf("enter starting amount&year");
scanf("%ld""%d",&p,&y);
while(y1<2009)
{
printf("enter current year");
scanf("%d",&y1);
printf("enter amount to be deposited");
scanf("%ld",&a);
i1=(p*r*t)/100;
total=i1+a+p;
printf("1%d",y);
printf("starting amount is %ld",p);
p=p+a;
printf("current year is %d",y1);
printf("interest is %f",i1);
printf("total amount is %lf",total);
}
getch();
}

c programme

#include
void main()
{
printf("welcome to world of c);
}