| | |
Give me the explanation for this output
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
c++ Syntax (Toggle Plain Text)
#include<iostream.h> #include<conio.h> void main() { int x[5]={1,2,3,4,5},y[5]={5,4,3,2,1},result [5]={0,0,0,0,0}; int i=0; while(i++ <5) result[i]=x[i]-y[i]; clrscr(); cout<<"\nThe contents of the array are :\n"; i=0; do { cout<<'\t'<<x[i]<<'\t'<<y[i]<<'\t'<<result [i]<<"\n"; i++; }while(i<5); getch(); }
The contents of the array are:
1 -1 0
2 4 -2
3 3 0
4 2 2
5 1 4
GIVE ME THE EXPLANATION FOR THIS OUTPUT.
e-mail to <EMAIL SNIPPED>
Last edited by peter_budo; 19 Days Ago at 5:02 am. Reason: Keep It On The Site - Do not post asking for an answer to be sent to you via email or PM.
0
#2 19 Days Ago
the output you posted is wrong. Here is the correct output. Had you bothered to compile and run that program you would have seen it too.
text Syntax (Toggle Plain Text)
The contents of the array are : 1 5 0 2 4 -2 3 3 0 4 2 2 5 1 4
Last edited by Ancient Dragon; 19 Days Ago at 10:28 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- How to display "\n" on output screen in C++? (C++)
- help to give program for this output? (C)
- Having a bit of trouble figuring out my image upload script (PHP)
- Not able to send email by "MAIL" (OS X)
- "Lost" emails in folders (OS X)
- Help "sell script to send a mail" (Shell Scripting)
- Mail Formatting lost when sending from Panther "mail" app. (Mac Software)
- Stuck on Mail() Function (PHP)
Other Threads in the C++ Forum
- Previous Thread: Beginner C++
- Next Thread: compiling multiple files using visual c++
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy desktop developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker list loop looping loops map math memory multiple news node number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference rpg sorting string strings struct temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






