Write a program that will prompt the user for a series of five float type values. Assign the float type values
608853
Code written in C and it works in C++\n\n#include <stdio.h>\n#include <conio.h>\n\nvoid main() {\n     float f[5];\n     int   i[5];\n     int j;\n     clrscr();\n     printf("Please, enter five float numbers: &#92;n");\n     for (j=0;j<5;j++){\n scanf("%f",&f[j]);\n i[j]=(int) f[j];\n     }\n     printf("Float value&#92;n");\n     for (j=0;j<4;j++)\n printf("%2.2f&#92;n",f[j]);\n     printf("&#92;nInteger value&#92;n");\n     for (j=0;j<4;j++)\n printf("%d&#92;n",i[j]);\n\n     getch();\n}
1158232
#include <iostream>\nusing namespace std;\n\nvoid main ()\n{\nint countDown= 0;\n\ncout <<"Enter the number you want to start from: ";\ncin >>countDown;\n\nfor ( countDown; countDown >= 0; countDown--)\n      cout <<countDown<<", ";\n}\n\nAny other question, just ask, eoroxter@gmail.com\nGood Luck,
379626
Try the Visual Basic Bible.  It'll set you back around $50, but it's an awesome book.
846187
if you are using a "while" or "do while" loop\n\nwhile ((x1 - x0) > 0.001)\n{\n//your code here\n}\n\nor you can do this\n\ndo\n{\n//your code here\n}\nwhile ((x1 - x0) > 0.001);
789559
Ten numbers per line, add 'em up and divide by 10.\n\nYou should get these means for the four sets:\n\n0.138, 0.172, 0.184, 0.156\n\nBe careful, since not all the numbers may show up on Yahoo unless you put your mouse pointer on the line.
129073
The code below will work.\n\nint main()\n{\nint aNum,i;\ncout<<"enter a number";\ncin>> aNum;\nfor(i=0;i<aNum;i++)\n{\nfor(j=0;j<=i;j++)//nested loop\ncout<<"*";// end of nested loop\ncout<<'&#92;n';\n}// end of outer loop\nreturn 0;\n}
966072
This link gives all the data types.\nAs you already know the numeric ones I suggest you remove them from the list so that you are left with the four you require.
816710
Create an outer for loop that will loop from 7 down to 0, with a step of 2.\n\nCreate one inner loops.\n\nThe inner loop should take the value of i, place it in another variable and count down to 0.\nThen print out the dollar signs for each iteration of this loop.
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
912485
there is no "code" for it. The compiler evaluates it at the compile time, and replaces with the actual number.\nThere is no way to write a function that would did that at run time, because at run time, there is not type information available - only addresses of variables not their sizes
725270
When an iterative calculations with predefined conditions are to be done, the need of loop arises.\n\nThe following are the loop constructs...\n\n1. While Loop:\n\nSyntax: \n\nwhile( x < 100 ) {\n     if( x < 0 )\n       break;\n     cout << x << endl;\n     x++;\n   }   \n\n2. for loop\n\nSyntax: \n\nfor( initialization; test-condition; increment ) {\n  statement-list;\n  }\n\n   for( int i = 0; i < 10; i++ ) {\n     cout << "i is " << i << endl;\n   }\n   int j, k;\n   for( j = 0, k = 10;\n        j < k;\n        j++, k-- ) {\n     cout << "j is " << j << " and k is " << k << endl;\n   }\n   for( ; ; ) {\n     // loop forever!\n   }            \n\n3. do \n\nSyntax: \n  do {\n  statement-list;\n  } while( condition );
814965
what c++ program are you referring to ...anyway the syntax is\n\n#include<iostream.h>\n#include<conio.h>\n...include all the header files here ..\n\nint count()\n  {\n     function body\n     return value #integer value to be returned \n\n  }\n\nother functions\n\nvoid main() \n\n   {\n\n# this is the main function \n\nint a,b,c;\nfloat al,bl;\nstring str;\n\n#declare the variables\n\n#get the inputs from the user\ncout<<"enter the value of a ";\ncin>>a;\n...\n...\n\ncall the functions\n\nb=count()\n..\n#do what ever processing has to be done\n } # program closing curly braces\n\n\nhope this helps\n\nthis is a excellent c++ tutorial \n\nhttp://www.geocities.com/sstutor\n\ncprogramming.com is also pretty good
267921
You can turn these into proper C++ statements:\n\nread a, b\n\nlet max = a\n\nif max < b\n  let max = b\nendif\n\nprint max\n\nThis program assumes that a <> b.
42408
Something that calculates numbers in rapid succession.
639176
Uses crt;\nVar\n   s1,s2,s3,s4,b1,b2:string;i:integer;\nBegin\n     Clrscr;\n     s1:='The quick brown fox jumped over the lazy dog ';\n     s2:='near the shallow river.';\n     Repeat;\n            Clrscr;\n            Gotoxy(40-(Length(s1) div 2),1);\n            Writeln(s1);\n            Gotoxy(40-(Length(s2) div 2),2);\n            Writeln(s2);\n            Repeat\n                  Writeln;\n                  Write('Change What: ');\n                  Readln(s3);\n                  Write('Change To: ');\n                  Readln(s4);\n                  If Pos(s3,s1)<>0 then\n                     Begin\n                          i:=Pos(s3,s1);\n                          Delete(s1,i,Length(s3));\n                          Insert(s4,s1,i);\n                     End;\n                  If Pos(s3,s2)<>0 then\n                     Begin\n                          i:=Pos(s3,s2);\n                          Delete(s2,i,Length(s3));\n                          Insert(s4,s2,i);\n                     End;\n                  Repeat;\n                         Write('Change another(Y/N): ');\n                         Readln(b1);\n                  Until (b1='Y')or(b1='y')or(b1='n')or(b1='N');\n            Until (b1='N')or(b1='n');\n            Clrscr;\n            Gotoxy(40-(Length(s1) div 2),1);\n            Writeln(s1);\n            Gotoxy(40-(Length(s2) div 2),2);\n            Writeln(s2);\n            Writeln;\n            Repeat;\n                   Write('Want to repeat(Y/N): ');\n                   Readln(b1);\n            Until (b1='Y')or(b1='y')or(b1='n')or(b1='N');\n     Until (b1='N')or(b1='n');\nEnd.
81883
Details of the algorithm for conversion along with\nsource program written in C can be found at.\nhttp://www.codepedia.com/1/Art_Expressions_p1\n\nA good short article on this topic.\nhttp://www.cs.man.ac.uk/~pjj/cs2121/fix.html
938758
write a program which will read the number as units,10's,100';s,1000's,10000's,100000's,1000000's,100000000's etc and store appropriate in english.  refer it and print eg.\n\n123 to print as one hundered and twenty three\n\n3  ---> store as three in a unit table  (3 is in unit, so read as three)\n2 ----> store as twenty in a ten table (2 is in 10, so read as twenty)\n1 ---->  store as one hundred in hundred table  (1 is in 100, so read as hundred)\n\nthen concantenate from the left\ni.e. one hundered twenty three \n\nadd only in the end\n\nwrite a program.  use brain to write the program.  there are so many ways, so many logic.  never post this type of question.\n\neach person's logic vary.  may be there will be very easy way of doing it.   and this program is very old.  this may have been written by innumerable number of programmers.  \n\nbye