![]() |
c++ guru, urgent plz
ex1:
Using a do while loop , write a calculator program that reads an arithmetic such as 12+34-2+65-21= from the user and gives you the result when it reads the equal sign.The expression can contain any number of integers and not just five as in the above example .The only arithmetic operators used are +,-,and = . (no strings, no arrays..) that's what they want for suggestion comments send ok ex3: input an integer containing only 0s and 1s (i.e a binary integer )and print its decimal equivalent plz cuz i dont have time to search |
Re: c++ guru, urgent plz
ex3 solved
first 1 plz |
Re: c++ guru, urgent plz
LOL man the first one is so easy
just create two integers x , y, one char z, and put two condition( if else condition for the char inputted by the user i mean the + , -) inside the "do while" loop, each time the user enters a number the loop add it or subtract it depending on the user request by selecting the sign he wants. similar to this Code:
if (z== '+')the code that i wrote should be in the do while loop the do while loop should have a condition to exit from the loop ya3ne declare an integer and assign a value to it if a ==1 than exit you should know how to write such stuff refer to the book ur studyin PS: dont copy my code its full of mistakes, and it is just a sample not a working one, im trying to help you and give you a convention how ur program should be |
Re: c++ guru, urgent plz
ma 3a add mannou hayyin ma fakkarit fi
3melet el sa3been men ta7it wou taraktou ma ba3reef chou sar, freezing... 10Q |
Re: c++ guru, urgent plz
Code:
int x, y; |
Re: c++ guru, urgent plz
I had this assignment last week, anyway here's the code.
Code:
#include <iostream> |
| All times are GMT +1. The time now is 03:14 AM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger