Member Avatar

can u help me convert the cout to printf..i dont have a clue how.. tnx [CODE]#include<iostream.h> #include<string.h> #include<conio.h> int findSimilar(char[],char[]); void checkValue(int,int); int main(){ char boy[50]; char girl[50]; int similarInBoy=0; int similarInGirl=0; int total; clrscr(); cout<<"Enter Boy's Name: "; cin.getline(boy,50); cout<<"Enter Girl's Name: "; cin.getline(girl,50); similarInBoy=findSimilar(boy,girl); similarInGirl=findSimilar(girl,boy); total=similarInGirl+similarInBoy; cout<<"Boy: "<<similarInBoy<<","; checkValue(similarInBoy,1); cout<<"\n"; cout<<"Girl: "<<similarInGirl<<","; checkValue(similarInGirl,2); cout<<"\n"; cout<<"Total: "<<total<<","; checkValue(total,3); cout<<"\n"; getch(); return 0; } void checkValue(int similar,int gender){ if(gender==1){ if(similar>6) similar%=6; switch(similar){ case 1: cout<<"Friend"; break; case 2: cout<<"Love"; break; case 3: cout<<"Affair"; break; case 4: cout<<"Married"; break; case 5: cout<<"Enemy"; break; case 6: cout<<"Sweetheart"; break; } } else if(gender==2){ …

Member Avatar
+0 forum 6
Member Avatar

I have heard that games can be built using c language. I request someone to post the code for a simple game.(if possible,simple code too)..

Member Avatar
-1 forum 13

The End.