Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

rambache

@rambache
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • cant make it stop, problem with small c++ code
    R rambache

    i have this problem, i am an amateur in programming c++ so i made this simple program: i have d0, d1, d2, and d3, i give them some values, then i have a, b, c, d, e, f, and g, and i want to calculate them with a math operation for each one, but that operation uses the d0, d1, d2, d3 values that you gave them before with the cin's, so, after you give the values to d0, d1, d2, and d3, the program closes itself because it finishes doing everything but i cant see the results for the a, b, c, d, e, f, and g operations. Can someone help me please. This is my code: #include <cstdlib> #include <iostream> #include <stdio.h> using namespace std; main() { int d0, d1, d2, d3; int a, b, c, d, e, f, g; //Meto los valores 0 y 1 de las variables d0, d1, d2, d3 cout<< "Inserte los valores de las siguientes variables:\n"<<endl; cout<< "Variables: d0, d1, d2, d3\n"; cout<< "TIENEN QUE SER 0 o 1\n"; cout<< "Inserte d0\n"; cin>> d0; cout<< "Inserte d1\n"; cin>> d1; cout<< "Inserte d2\n"; cin>> d2; cout<< "Inserte d3\n"; cin>> d3; cout<< "Ahora se muestran los valores de cada segmento\n"; //Calculo los valores de las variables a, b, c, d, e, f, g, utilizando los valores de d0, d1, d2, d3 a= ((d0&&d2)||(!d0&&!d2)||(d1)||(d3)); b= ((d0&&d1)||(!d0&&!d1)||(!d2)||(d3)); c= ((d0)||(!d1)||(d2)||(d3)); d= ((!d0&&!d2)||(!d0&&d1)||(!d0&&d3)||(d1&&!d2)||(d1&&d3)||(d0&&!d1&&d2)); e= ((!d0&&d1)||(!d0&&d2)); f= ((d0&&d2)||(d0&d1)||(d2&&d2)||(d3)); g= ((!d0&&d1)||(!d1&&d2)||(!d1&&d2)||(d3)); //Muestro los valores en pantalla cout<< a <<"\n"; cout<< b <<"\n"; cout<< c <<"\n"; cout<< d <<"\n"; cout<< e <<"\n"; cout<< f <<"\n"; cout<< g <<"\n"; }

    C / C++ / MFC help c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups