C/C++ :: Multiply 2 Variables That Go From 0 To 7 - Logical Operators?
Apr 9, 2015
#include <iostream>
using namespace std;
int main(){
int polje[8][8];{
for(int i=0;i<8;i++)
for(int j=0;j<8;j++) {
[Code] .....
I don't get any errors,the program works. The problem is that it doesnt work how it should. This is a simple program that multiplies 2 variables(i and j)that go from 0 to 7. The problem I have is with the logical operators,i want the program to skip multiplication with 0 and when the 2 variables are the same value. When i try using only 1 logical operator it work.
View 2 Replies
Dec 20, 2013
I wrote this program using an online compiler i am getting a lot of errors.
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
string birthmonth;
string birthday;
[Code] ....
View 6 Replies
View Related
Feb 26, 2013
I am new to C programming and I am just wondering how to multiply / divide two different variables which the user type in as the promt is asking like this:
Code:
void inmatning3 (double *a, double *b) {
printf("Mata in tv217 stycken flyttal: "); /* asks you to type in 2 numbers */
scanf("%lf %lf", a, b);
}
When you've enterd the two numbers I need to eather multiply or divide the two variables "a" & "b" .....
View 5 Replies
View Related
Feb 2, 2013
There are, or course, better ways to do this, but I need to stick to some rules:
(1) Use only pointer variables and not arrays or structs.
(2) Use the three functions shown--regardless of easier methods.
The program should ask for some input, operate on those numbers, and then display the results. I know I am confused over these things:
(1) All that syntax using '*' and '&' or neither.
(2) How to use the char type correctly.
(3) How to use a char type input as an operator (a + b).
(4) How to use the pointer of the operator variable (+,-,*,/) in an actual equation.
Code:
#include <stdio.h>
#include <stdlib.h>
// *** Prototype Functions ***
void Post_Results (float*);
void Calculate (float*, float*, char*, float*);
void Get_Numbers (float*, char*, float*);
[Code]......
View 5 Replies
View Related
Mar 9, 2013
I've received a segmentation fault in this part of code:
Code:
for (; str[i] != '