C++: how 2 write a program 4 circular loop??
can u plz design a program 4 me in C++ 4 circular loop?? d details dat i have is: ders an array.. d user inputs an address of any variable in d array.. den a circular loop is exacuted..
can u plz design a program 4 me in C++ 4 circular loop?? d details dat i have is: ders an array.. d user inputs an address of any variable in d array.. den a circular loop is exacuted..
Comments
If you want somebody to write a program for you, the least you could do is explain yourself clearly, in plain English. There is a perfectly good spelling checker built into Y!Answers - use it! "Dat" and "den" are things you _say_ (because you have a regional accent), not things you _write_ (regional accents are not transcribed). You've saved yourself a few keystrokes, at the expense of being comprehensible.
particularly than applying int as numbers i might propose to apply a waft kind, simply by fact it particularly is not nonsense to accomplish arithmetic operations on numbers with i.e. a decimal factor. . the effect in this actual software will practice an entire quantity in case the forged to long could have an identical fee simply by fact the double (There must be rounding blunders, however) #contain <stdio.h> #contain <stdlib.h> double upload(double a, double b) {return a + b;} double minus(double a, double b) {return a - b;} double multiply(double a, double b) {return a * b;} double divide(double a, double b) {return a / b;} double get_userinput() { double a = 0.0, b = 0.0, dblResult = 0.0; int iRet = 0; char c; int bContinue = 0; do { printf("Please enter 2 numbers and an operator(+-*:)> "); bContinue = 0; iRet = scanf("%lf %lf %c", &a, &b, &c); if (iRet == 3) { change(c) { case '+': dblResult = upload(a, b); wreck; case '-': dblResult = minus(a, b); wreck; case '*': dblResult = multiply(a, b); wreck; case ':': case '/': dblResult = divide(a, b); wreck; default: bContinue = a million; printf("Unknown operator!"); wreck; } } }on an identical time as(iRet != 3 || bContinue); return dblResult; } int significant() { double dblResult = get_userinput(); if ((long)dblResult == dblResult) printf("%.0lf", dblResult); else printf("%.2lf", dblResult); return EXIT_SUCCESS; }
Give more details