Обсуждения
[C++]Code for outputting maze
1 голос
1 ответWhy this code not showing output?
-2 голосов
2 ответовExplaination Part 2. Please help me.
4 голосов
1 ответwhy does this code output that there is an error because the else statement doesn't have a corresponding if statement?. How do i correct this?
#include <iostream>
using namespace std;
int main() {
int a;
for (int x =0; x<5;x++){
cin>>a;
if (a<1){
cout<<"a cannot be less than 1\n";
}
else if (a>10){
cout <<"a cannot be greater than 10\n";
}
}
else{
cout<<"code can run now"<<endl;
}
return 0;
}
3 голосов
8 ответовi need c++ program does EXAMPLE: If the user entered the #’s: 999, 90,78,82,and 999
the output would be
AVERAGE = 250/3 = 83.3 AVERAGE WITH LOWEST DROPPED = 172/2 = 86.0
AVERAGE WHERE HIGHEST COUNTS TWICE =340/4 = 85.0
NOTE: Validate the input as being a plausible test score and require the user to reenter when not plausible.
1 голос
7 ответовWhy not normal I/O
0 голосов
1 ответI'm trying to calculate the decimal places of pi with Ramanujan's formula. but with this code I'm getting the same output for all values of n, which it shouldn't.
from math import sqrt, factorial as f
sum=0
n=0
k=(2*sqrt(2)/9801)
while n<=100000:
sum=sum+((f(4*n))*(1103+(26390*n)))/(((f(n))**4)*(396**(4*n)))
y=1/(k*sum)
print('%.60f' % y)
n=n+1
where am I doing wrong?
2 голосов
4 ответовContinuous problem
1 голос
1 ответWhat does the 'cout' operator do?
2 голосов
2 ответовАктуальное сегодня
SQL
3 Votes
HTML/CSS questions
0 Votes
IMAGE
0 Votes
Html
1 Votes
How to learn css and html
0 Votes
Certificate Problem
0 Votes
Find courses
0 Votes