C++ :: Odd And Even Integers - How To Output On Screen
Apr 18, 2013
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main()
[code]....
I do not know how to output on the screen, I believe that i have written it to the file correctly but i dont know how to output it.
View 1 Replies
ADVERTISEMENT
Feb 11, 2014
I have turbo c++ on windows xp SP2.....whenever i compile my code in turbo c++ i am getting output outside the screen.....but when i used code::block....i get the correct output...fits to screen ...
View 7 Replies
View Related
Jun 25, 2014
why I can't output ounces on the screen in c#...here's the code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Chapter7Problem12
{
class Program
}
[code]....
View 6 Replies
View Related
Oct 29, 2013
I want to write a program that makes this output to appear on screen using for-loop :
0 0
1
2
3
4
5
1 0
1
2
3
4
5
2 0
1
2
3
4
5
3 0
1
2
3
4
5
I can't seem to make the correct logic/engine of this nested loop.
View 11 Replies
View Related
Feb 2, 2014
I managed to write successfully my code that I have been wanting to write for some years now, but I want to align the text that is displayed in the output screen but I haven't been able to. I've tried adding and taking away numbers from the identifiers but nothing.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#define ARRAYSIZE 2
#define FORMAT "First Name Pago1 Pago2 Pago3 Pago4 Total Net"
#define FORMATHEADER "Last Name "
[code].....
View 1 Replies
View Related
Nov 21, 2013
how to display an image on the output screen of c++ program.
I am using : Turbo c++(dos box) on win8
View 1 Replies
View Related
Oct 13, 2013
I am having trouble outputting the file "output1.dat" to the screen. here is my code -
#include <fstream>
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
//Outputs a description of what this program does
void intro();
void sort_merge(ifstream& in_1, ifstream& in_2, ofstream& out_1 );
[Code] .....
View 2 Replies
View Related
May 26, 2013
How can I make the output print out to the screen in reverse?
Code: #include <iostream>
#include <iomanip>
using namespace std;
int getnum();
void Fibonacci(int n);
[Code].....
View 7 Replies
View Related
Sep 13, 2014
/* This is what I have so far what i am trying to do is to initialize the arrays at zero and output the board to the screen. Part of the problem is the user has the option of the board size. All this is suppose to do is to output the board to the screen. I am having problems understanding 2D Arrays.
*/
using namespace std;
int main() {
const int BOARD_MAX = 10; // Maxinum Board size.
const int BOARD_MIN = 3; // Minimum Board size.
array = [COL];
array [ROW];
[Code] ....
View 5 Replies
View Related
Sep 17, 2013
I created a C program that extracts some information from computer and displays it on screen. It is completed today and is going to be applied to startup programs of domain machines. It runs at logon and takes somewhat 5-10 seconds to finish execution. The output is shown on console screen & user can either close the window by clicking on 'x' or pressing 'Ctrl+c' during execution. How do i prevent both of these events?
Basically the most time consuming processes are
Code: popen("systeminfo","r");
popen("wmic qfe get installedon","r");
1st command is getting OS name,version and hotfixes installed.
2nd command gives me the date of updates installed.
I then filter out data & print required information only.
View 3 Replies
View Related
Jan 27, 2013
i am using c++v30.5 version i want red color text in in my output screen . i viewed various site but the result is 0 ,wat to do?
View 2 Replies
View Related
Feb 5, 2014
My professor wants me to write a program that will read from a dat file, and produce an output on the screen based on the file. I don't understand why I am getting this error. I suspect it has something to do with the number of characters I've told it to read.
#include<iostream>
#include<iomanip>
#include<fstream>
#include<assert.h>
#include<string>
using namespace std;
using namespace System;
struct TStudent {
string month[10];
[Code] .....
I noticed I had a 2 beside girl, after I removed it, it still didn't fix my problem.
View 8 Replies
View Related
Jan 14, 2015
So I'm supposed to write something that will output a multiplication table from two user input integers between 2 and 10.
For example it should display like this is the user inputs 4 and 5
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
I was hinted to used two for loops and this is what I have thus far, what I can't figure out is how to display it like the example.
#include <iostream>
using namespace std;
int main() {
int num1;
int num2;
cout << "Enter two numbers between 2 and 10." << endl;
[Code] .....
View 2 Replies
View Related
May 1, 2013
Write a C++ program that reads in two positive integers that are 20 or fewer digits in length and outputs the sum of the two numbers.
Your program will read the digits as values of type char so that the number 1234 is read as four characters '1', '2', '3' and '4'. After they are read into the program, the characters are changed to values of type int. The digits will be read into a partially filled array and you might find it useful to reverse the order of the elements in the array after array is filled with data from the keyboard.
Your program will perform the addition by implementing the usual pencil and paper addition algorithm. The result of the addition is stored in an array of size 20 and the result is written to screen. if the result of the addition is an integer with more than maximum number of digits(that is more than 20 digits) then your program should issue a message saying that it has encountered "integer overflow".
You should be able to change the maximum length of the integers by changing only one globally defined constant. Include the loop that allows the user to continue to do more additions until the user says the program should end.
For some reason the sum won't add or output though, This is what i have so far:
#include <iostream>
using namespace std;
const int MAXIMUM_DIGITS = 20;
void input_Large_Int (int a[], int& size_of_A); //input function for the two big integers
void output_Large_Int(int a[], int size_of_A); //output function for the two big integers and the sum integer
void add(int a[], int size_of_A, int b[], int size_of_B, int sum[], int & size_Sum); //add function for the big integers' sum
[Code] .....
View 1 Replies
View Related
Apr 30, 2013
so basically my project goes like this:
Write a C++ program that reads in two positive integers that are 20 or fewer digits in length and outputs the sum of the two numbers.
Your program will read the digits as values of type char so that the number 1234 is read as four characters '1', '2', '3' and '4'. After they are read into the program, the characters are changed to values of type int. The digits will be read into a partially filled array and you might find it useful to reverse the order of the elements in the array after array is filled with data from the keyboard.
Your program will perform the addition by implementing the usual pencil and paper addition algorithm. The result of the addition is stored in an array of size 20 and the result is written to screen. if the result of the addition is an integer with more than maximum number of digits(that is more than 20 digits) then your program should issue a message saying that it has encountered "integer overflow".
You should be able to change the maximum length of the integers by changing only one globally defined constant. Include the loop that allows the user to continue to do more additions until the user says the program should end. What I have so far is
#include <iostream>
#include <cstdlib>
using namespace std;
void reverseArr(int a[], int liu);
void addLargeInt(int a1[], int liu1, int a2[], int liu2, int sum[], int& liu_sum);
int main() {
cin.get(next);
[Code]...
View 2 Replies
View Related
Apr 21, 2014
I'm a beginner at c++ and I need to write a program that reads a set of integers and then finds and prints the sum of the even and odd integers. The program cannot tell the user how many integers to enter. I need to have separate totals for the even and odd numbers. what would I need to use so that I can read whatever number of values the user inputs and get the sum of even and odd?
View 2 Replies
View Related
Mar 19, 2014
So i am struggling for days to get this done and all i need is to get the sum of the areas and get them printed on the screen my code is this:
Code:
#include<stdio.h>
#include <stdlib.h>
#include<conio.h> //Not needed in Dev C++//
#define PI 3.1415
float Area_of_Rectangular(float length,float width);
float Area_of_Circle(float radius);
int main()
[Code]...
View 7 Replies
View Related
Oct 31, 2013
My problem is :
Code: numbers[10]={25,27,17,19,47,3,98,5,124,10};
You write a program at do below processes for above array.
You want a number 1 between 10 at user.
if user enter N value,program write to screen lowest N. number at array. For example user enter 2,program write to screen lowest secondary number of 5 value at array or user enter 10 value,program write to screen maximum number of 124 value at array.
But write the program with don't use sorting algorithm.
View 6 Replies
View Related
Nov 4, 2013
I have a one simple question :D. I want to output to the console some symbols. Let's say that i have a loop.
for(int i = 0; i < 10; i++) cou << "* ";
Then I want to output other symbols but I want to overwrite the previous symbols. I know I can use system("cls"); but it blinks if I try to output the same characters. For example if I have:
for(int i = 0; i < 10; i++) cou << "* ";
system("cls");
for(int i = 0; i < 10; i++) cou << "* ";
After I run this code the first loop outputs ten "*". Then there is a blink and there are again ten "*" shown. How can I avoid this blink?
View 4 Replies
View Related
Oct 14, 2013
I have screen scrolling up and running but it keeps going after the background finishes. how do you fix that?
View 4 Replies
View Related
Oct 8, 2014
For my class we have to take a screenshot of the program and put it in a word document. How can I accomplish this?
View 2 Replies
View Related
Jul 19, 2013
so im trying to make a background for a menu, but it is only so big. its not the kind of picture where i can just reapply it. is there a function to make it fill to the screen?
View 4 Replies
View Related
Mar 29, 2013
I've got most of the program to work but its printing to the screen 5 times and I only want it to print once.
Eg:
cos1512: 57.00%
mat1512: 86.50%
inf1520: 65.10%
cos1521: 78.40%
inf1505: 89.10%
but I get:
Semester Marks:
================
cos1512: 57.00%
mat1512: 57.00%
inf1520: 57.00%
cos1521: 57.00%
inf1505: 57.00%
cos1512: 86.50%
.....
My code:
#include <iostream>
using namespace std;
class Module {
public:
void setModules(string module1, string module2, string module3, string module4, string module5);
void setMarks(int aMark1, int aMark2);
int updateMarks();
[Code] .....
View 4 Replies
View Related
Nov 7, 2013
I want to have my program only clear a section of the lines displayed on screen. For example if:
Welcome. Enter : (cin)
Choose a mode: (cin)
(etc...)
Clear above lines (for example) 1 and 2?: (cin)
//now I want the program to do that. How?
Overall, I want to be able to system ("cls") only certain lines.
View 7 Replies
View Related
Nov 3, 2014
Is there any way I can clear only a selected part of the screen? (I'm aware of system("cls"))
For example, when you enter a date, and is wrong, could it just errase that input and only say "Wrong try again" without errasing everything else you where doing?
In this case, a function that only errases what is in the while
while(not wrong)
{
cout<<"DIA: ";
cin>>obj.dia;
cout<<"MES: ";
cin>>obj.mes;
cout<<"ANIO: ";
cin>>obj.anio;
}
PS: Also, is there any whay in which you can ask the user to enter the date DD/MM/YYY?
View 1 Replies
View Related
May 15, 2013
I had a program (on console) that uses a third-part software to draw some graphs. In order to hold the graphs on the screen, I used cin.get(); and that worked.
Now I created a GUI with Qt. The code remains generally the same. The code continues to call the software to draw graphs (during drawing graphs, there is a console opened automatically). Butcin.get(); in the code cannot hold the graphs on screen anymore. The graphs appear and disappear immediately.
View 4 Replies
View Related