i have a program and i wish to know if it is functional or not. and below is the program that i have written : \n\n#include <stdio.h>\nmain ()\n{\n double S, R, x \n  int i , N \n  scanf ("%d" , &N)\n  S= 0\nfor ( i = 0, i <= N ; ++i )  {\n S = i * i }\n\n i = x\n R = (x + 2/x) /2 \nwhile ( R != R ) {\nx= R\nR = (x+ 2/x) /2\n}\n\nprintf ("%f&#92;n", R)\n}
217040
I can see by looking at it that it won't compile.\nYou don't have semicolons at the end of the lines.\n\nI you put in the semicolons and replace the comma in the for loop with the another semicolon, it will compile and run.\n\nHowever, I don't think that you will get what you expect.\n\nYou use x without initializing it. That means that x will take the value that is already in memeory at that address.\n\nNext you condition your while loop on (R!=R) which is always false, so the while loop never executes.\n\nWhat you will print out is the last value that was left in x which is a location on the stack. \nI'm running MS C++ in debug mode, so it fills in the bytes of x with the value CC so you can recognize it as uninitialized stack memory.\n\nLast, you compute S but never use it.
461438
Here is a program which first computes all the values and then, print it in the actual table manner. If value is 34, table for 1 to 10 will be printed first, then from 11 to 20, 21 to 30 and then from 31 to 34. \n\n#include <stdio.h>\n#include <conio.h>\n\nvoid main()\n{\n clrscr();\n int a[50][12];\n int n;\n printf("Enter the number till which you need tables ");\n scanf("%d",&n);\n for(int i= 1;i<=n;i++)\n  for(int j=1;j<=12;j++)\n   a[i][j] = i*j;\n\n for(int k=1;k<=n/10;k++)\n {\n\n  for(i = 1;i<=12;i++)\n  {\n   for(int j = (k-1)*10+1;j<=(k-1)*10+10;j++)\n    printf("%d&#92;t",a[j][i]);\n   //printf("&#92;n");\n  }\n  printf("&#92;n");\n  getch();\n }\n\n for(i = 1;i<=12;i++)\n  {\n   for(int j = (n/10)*10+1;j<=n;j++)\n    printf("%d&#92;t",a[j][i]);\n   printf("&#92;n");\n  }\n  printf("&#92;n");\n\n}
328571
Your program is only a good as the documentation. Your program may be a work of art, but if it is not documented properly, then it will not achieve it's full potential. It is the same with any system design.  If it is not documented properly, or is not worded in plain english, then\nthe entire system suffers.
247797
INT[(1 - x)/x dx]\nINT[x^-1 (1-x) dx]\nINT[x^-1 - 1 dx]\nln|x| - x + C
173180
I'd dump it into a compiler and do it for you but you left too much out.  Impossible to return a syntax error free version without the whole program.\n\nAnyways, I get paid for this.  How many points is this worth?  ...to do someone's homework for him?  Or maybe he's doing contract work!  He's getting $70 and hour to let us do it for him!
523201
u have to ponit it or use\n\nthese are the 2 way's:\n\n#include <iostream>\nusing namespcae std;\nint main()\n{\nint num[8];\nint index;\n\nnum[0] = 42;\nnum[1] = 2001;\nnum[2] = 7;\nnum[3] = 180;\nnum[4] = 99;\nnum[5] = 1993;\n\nfor(index = 0; index <= 5; index++)\n{\nstd::cout<< index[num] << endl;\n}\n system("pause");\nreturn 0;\n}\n\nor\n\n#include <iostream>\n#define MAX 20\nusing namespcae std;\n\nint main()\n{\n\nint a[MAX] = {23,43,4,5,34,343,12,14};\nint b;\n\ncout.setf(ios::right);\n\nfor(b = 0; b < MAX; b++){\n\ncout << endl << endl;\n\ncout << "The Elemnt in ";\n\ncout.width(2);\n\ncout << (b +1) << " is ";\n\ncout.width(2);\n\nstd::cout << b[a];\n}\nreturn 0;\n}
111069
-------\n           ( START )\n            -------\n               |\n               V\n       ------------------\n      | Num ctr, sum ,no |    \n       ------------------  \n            | \n            V\n       -----------------\n      | ctr = 1, sum=0  | \n       -----------------\n            |<----------------\n            V                 |\n          -----------         |\n        / Accept no /         | \n        ------------          |\n             |                |\n             V                |\n       ----------------       |\n      | sum = sum + no |      |\n       ----------------       |\n             |                |\n             V                |\n       ----------------       |\n      | ctr = ctr + 1 |       |\n       ----------------       ^\n              |               |\n              V               |\n             /&#92;               | \n            /  &#92;              |\n           /ctr &#92;             |\n          / <=80 &#92;    YES     |\n          &#92;      /------------>           \n           &#92;    /\n            &#92;  /\n             &#92;/\n             | NO\n             V                \n          -------------         \n        / Display sum /          \n        --------------          \n             |                \n             V                \n          -------\n         (  END  )\n          -------
527256
First answerer correct.  \n\nBut the second set is a function, because there are no repeated x values.  If you have a component of the first set corresponding to two different components of the second, then it isn't a function, e.g. in the second set, if the next pair were (15, 5) then it wouldn't be a function because of the double result for 15.  In the first set, if your misprinted pair were (1,2) then it wouldn't be a function, same reason.
367156
Yes it is a function because by the verticle line test it only intersects that line at 1 point.  \n\n\n It is a pretty simple test.  if a verticle line hits the graph at more than 1 point it is not a function.
91887
A compiler (you may know) is the program that translates your C++ code into the language of ones and zeros that the computer understands.  As such, it does not have to look spiffy.  Ugly is okay.\n\nThere are some differences among compilers as to exactly how you use them, but the general idea goes like this.  You write your C++ program in an editor and save it to disk.  You tell the compiler where to find the program and it reads it and tries to translate it into machine language.  It fails because no one can write a perfect program the first time.  It gives you a list of errors it found.  You patiently go through the list and correct the errors as best you can, then try to compile the program again.  You keep repeating editing (debugging) and compiling until the program compiles.  Then, you find out that it doesn't do what you meant for it to do.  That is because there are still errors in the program.  You find the errors, correct them, and compile again.  You keep doing this over and over, and eventually, the program works the way you want it.\n\nYour first programs should be very, very, very simple.  I hope your book guides you in this direction.  The first program should do something like print "hello."  Once you get to that point you can enhance it.  It might ask you to input something, then output that.  You keep making more and more complicated programs, and eventually, you'll be able to program interesting stuff.\n\nGood luck!!\n\n=====================\n\nI searched google for open source compilers and the two that came out on top are linked below.  Maybe you would like one of those better.
62710
C solution:\n\nint nr[20];\nint valid=1,i,j;\nint main(int argc, char **argv){\nfor (i=0;(i<20)&&(valid);i++){\n scanf("%d",&nr[i]);\n if (nr[i]<10)||(nr[i]>100){\n  printf("Invalid number");\n  valid=0;\n }\n for (j=0;j<i;j++)\n  if (nr[j]==nr[i]){\n    printf("Duplicate number");\n    valid=0;\n  }\n}\n}
302259
Condition = "True" ... i.e. <> 0\n\nthe interpreter "sees" the semicolon (;) as the end of the if statement, then sees the else but the else does not have a matching if, so it ignor's it!!! the printf("False") statement is a unconditional statement and always get's printed. This is an example of poor programming.
493094
Try Bloodshed Software's version of C/C++ instead.  It's free just like Turbo C from Borland.\n\nhttp://www.bloodshed.net/devcpp.html
440194
When you use functional notation, you put whatever is in the parentheses in the place of x in the original function.\n\nSo if f(x) = 3x\n\nf(x+1) = 3(x+1) = 3x+3\n\nIf f(x) = 2x\n\n3 + f(x + 4) = 3 + 2(x+4) = 3 + 2x + 8 = 2x + 11\n\nHope that helps.
638987
Take a look at this site.\nhttp://www.functionx.com/visualc/index.htm
20125
#define TRUE  1\n#define FALSE 0\n\n#define ESC      27\n#define F2      188\n#define UP      200\n#define FWD     205\n#define DN      208\n#define BS      203\n\nint getkey(void);\nint keyhit(void);\nvoid curr_cursor(int *, int *);\nvoid cursor(int, int);\nvoid hidecursor(void);\nvoid unhidecursor(void);\nvoid savecursor(void);\nvoid restorecursor(void);\nvoid set_cursor_type(unsigned);\n#define normalcursor() set_cursor_type(0x0607)\n\n\nlook at this code to understand how each function works.\n\nhttp://202.179.135.4/data/DDJ/articles/1991/9103/9103i/9103i.htm#00c1_0013
98517
I am giving the solution in C++ using recursion..\n\n!!\n\n#include<iostream.h>\nvoid printstars(int n)\n{\nfor(int k=0;k<n;k++)\n     cout<<"*";\ncout<<endl;\n}\nvoid print1(int n)\n{\nif(n<=1)\n   printstars(n);\nelse\n   printstars(n-2);\n}\nvoid print2(int m,int n)\n{\nif(m==n)\n   cout<<endl;\nelse \n{\n   printstars(m);\n   print2(m+2,n);\n}\n}\n\nmain()\n{\nint n,m=1;\ncout<<"Enter an odd number n";\ncin>>n;\nprint2(m,n);\nprint1(n);\n}\n\nThis produces the output u needed and also uses recursion.