0
How to fix “looks like your program needs input” ??
8 odpowiedzi
+ 2
/*Trs Less You are using void main() but it should be int main() {
system("pouse") dont work here.remove it.
add headers in separate lines.
Next your program need 3 inputs height, width, symbol so add 3 values in pop-up line by line, here space separated also works..
Sample input :
2 5 +
Output you see is :
Height:Width:Symbol: + + + + +
+ + + + +
And what in supposed to do with that window in this code
*/
// modified code to work correctly:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int height, width;
cout << "Height:\n";
cin >> height;
cout << "Width:\n";
cin >> width;
char symbol;
cout << "Symbol:\n";
cin >> symbol;
for (int h = 0; h < height; h++) {
for (int w = 0; w < width; w++) {
cout << setw(3) << symbol;
}
cout << endl;
}
//system("pause>0");
}
// input sample: 5 5 *
// you can see clear output now.
+ 2
If you can add a code here, we might have more of an idea.
Have you tried giving an input?
+ 2
That's a pop-up window asking the inputs required..
*And*
In SL, you need to provide all required input by a program in the pop-up window by line by line ( or space separated if works) at running before hand..
example, in your program, enter a number in widow and hit submit. observe output...
+ 2
You enter each input on a new line
180 //(height)
76 //(weight)
^ //(symbol)
Hit submit
+ 1
That is my code
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter Number :";
cin>>n;
if (n>100){
cout‹<"Number is greater than 100 .";
}
else {
cout<<"Number is smaller than 100 .";
}
return 0;
}
And when i try to run the code it says looks like your program needs input
+ 1
Jayakrishna🇮🇳 Tysm broo you saved me💕💕💕
0
And what in supposed to do with that window in this code
#include <iostream> #include<iomanip>
using namespace std;
void main()
{
int height, width;
cout << "Height:";
cin >> height;
cout << "Width: ";
cin >> width;
char symbol;
cout << "Symbol: ";
cin >> symbol;
for (int h = 0;
h < height; h++) {
for (int w = 0;
w < width; w++) {
cout << setw(3) << symbol;
}
cout << endl;
}
system("pause>0");
}
0
Same thing bro it’s not running properly :/