anonymous
  • anonymous
what does this mean? scanf("%d",&n);
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
This means that the program will wait for input and take a (d)ecimal and place it in the address of the n variable .
anonymous
  • anonymous
so can u rephrase it in "cin" ?? because scanf means cin right??
anonymous
  • anonymous
It means it will prompt the user to input a integer number and store its value in 'n'. %d signifies that the data type of input should be an integer. & signifies that it is stored in a particular address.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
they are similar. scanf is for c and cin is a c++ construct.
anonymous
  • anonymous
yep. but i want it to be just clear. ahmm by just showing "cin and cout". so can u rephrase that into cin ??
anonymous
  • anonymous
im using c++ actually not c. so im really confuse
anonymous
  • anonymous
#include using namespace std; int main() { int n; cin >> n; cout << n << endl; return 0; }
anonymous
  • anonymous
The scanf requires the type to be specified, the cin will display based on the type of variable.
anonymous
  • anonymous
can u show me a code. printing a pyramid ? for example, i type 5. this would be the output: * ** *** **** *****
anonymous
  • anonymous
Pyramid example: #include using namespace std; int main() { int count; cin >> count; for(int i = 1; i <= count ; i++) { for (int j = 1; j <= i; j++) { cout << "*" ; } cout << endl; } return 0; }
anonymous
  • anonymous
if you use c++ use cin
llib_xoc
  • llib_xoc
Scanf is a C standard-library function which reads data from the stdin channel, decodes it according to the format string (argument 1), and stores it in the variable that argument two points to. Lots more info at http://dinkum.com/manuals/?manual=compleat&page=lib_scan.html#Scan%20Functions.

Looking for something else?

Not the answer you are looking for? Search for more explanations.