| | |
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; Nov 4th, 2009 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.
-7
#2 Nov 3rd, 2009
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; Nov 3rd, 2009 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 |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib library lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






