C++ Help With "If" Statements?
930756
#include<iostream>\nusing namespace::std\n\nvoid main(){\ncout<<"Plz enter a number"<<endl;\nint x;\ncin>>x;\nif(x!=4)\n{\ncout<<"Well Done"<<endl;\n}\nelse {\ncout<<"The Number You Entered is 4"<<endl;\n}\n\n};\n\nI GUESS THIS IS WHAT YOU MEAN. YOU DONT NEED A BOOLEAN OPERATOR IN THIS CASE.
344651
Hey, email me, LBphan@gmail.com, i might be able to help you out a bit, ive got some stuff for c++ and c# if youre curious, and ill give you whatever youre looking for free of charge.  my name is andy, by the way.
82337
if(myWeight <= 3) {\n   value = myWeight * 5.45;\n} else if (myWeight <= 7) {\n   value = myWeight * 8.45;\n} else if (myWeight <= 15) {\n   value = myWeight * 11.45;\n} else {\n   value = myWeight * 14.45;\n}
172063
http://www.thefreecountry.com/compilers/cpp.shtml
207605
bool function(int a, int b, int c)\n{\nreturn a || b || c;\n}
515624
You can start off by declaring a new integer variable "low", initialize it to 0, and then after any input compare the new value to the value in low and if the new value is lower then set low equal to the new value.\nThe following sites should also be of use.
169151
int\nmain (void)\n{\nfor(i=0;i<10;i++){\nprintf("some thing output here %d", i)\n}\n}
751233
I'm not sure why you are avoiding the loop, but you could use recursion instead. If I understand your question correctly this function in c++ should give you your desired results.\n\nint sum(int nbr){\n    if(nbr > 0){\n           return(nbr%10 + sum(nbr/10));       \n    }\n    else{\n         return(0);\n    }\n}\n\nIf you called it with a number such as 256, it would return an answer of 13, or the sum of each digit in the integer.
202107
Try this:\n=IF(A1>0,A1-(A1*0.1),A1) \nin cell C1. \n\nAlso, you didn't specify what happens when A1=0. If C1 = A1, then the above will work, if not, try this:\n=IF(A1>0,A1-(A1*0.1),IF(A1<0,A1,Zero Value))
691129
<> means 'not equal to'\n\nThe C/C++ equivalent is != \n\n a <> b : means 'a is not equal to b'\n 5 <> 6 : gives the value True\n 5 <> 5 : gives the value False
781094
Nobody is going to do your homework for you. \n\nIf you're supposed to write code examples that illustrate how two comparable programs might look, then do this. Write some simple programs in C, and then re-write the same program in C++ but put the functions your void main calls in a class and instantiate the class.
670568
Try Planet Source Code:\n\nhttp://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3270&lngWId=3\n\nThis one's in C++. You should be able to convert it back to C...
411292
static_cast<int>("A") = 65\n\ngives you the ASCII value of the character\n\nWhole program:==============================================\n\nchar array[25]={'A','B',.....'Z'}\n\ncout << "Enter number: ";\ncin >> number\n\nif(number <= 10){\n  cout << number;\n}\nelse\n cout << array[number- 10];\n\nThat is the basic program you need to write it will work just dress it up to look pretty
755977
First of all--do your own homework, but you need a function like this:\n\nvoid print_okay()\n{\ncout << "Calculations indicate that you will make it to the next gas station" << endl;\n}\n\n\nand wherever the if statement is in the main function, you need an else after it that calls print_okay();
876944
I'm not fully sure of what you're trying to do here, but if you're trying to make sub-menus you can simply put all of the cout and cin statements for each sub-menu in between the cout<<" You selected... etc."; and the break statements. If you want it in another function, you can do:\n\nint main() {\n\n   //Other lines of code...\n\n   switch (choice)\n   {\n      case 1:\n         cout<< " You selected item 1.&#92;n";\n         //Call the first menu\n         menu1();\n         break;\n      }\n   }\n\n   void menu1() {\n      //This is the first menu!\n      int choice;\n      cout<< "This is the first menu...&#92;n";\n      cout<< "Pick something!&#92;n";\n      cin>> choice;\n      //Do other stuff here\n   }\n\n\nSorry if this doesn't help; I don't know C++ very well, and if you could expand on what you want to do I could help more. If this is what you want, then it's all good!
1065652
void main()\n{\ncout<<"no"<<"/t"<<"id.no"<<"/t"<<"name"<<"/t"<<"sex"<<"/t"<<"department";\ncout<<"1 001/98 sarafcomputerscience&#92;n";\ncout<<"your information";\ncout<<"your information";\ncout<<"your information";\ncout<<"your information";\n\n}\nif u want to get input at runtime try to input thr cin>> statement and get that output by cout statement
101541
This is kinda wierd without drawing it out, but I'll try to explain and you can come up with the picture.\n\n1)  Start Program\n2)  Accept Input\n3)  Add 1 to counter\n4)  If counter is not equal to 3; go to #2\n5)  If N2 > N3, do #6-8; if not, go to #9\n6)  Move N3 to a hold field\n7)  Move N2 to N3\n8)  Move the hold field to N2\n9)  if N1 > N2, do #6-8 with the N1 & N2 replacing each other\n10) if N2 > N3, do #6-8\n11) print them