473,699 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to program the square astrisk that the user is inputted

1 New Member
#include <iostream>
using namespace std
int main ()

{
cout<<"please input the size of the square");
cin>>("%d";& size);

for(int i=0;i<size;i++)
{
for(int j=0;j<size;j++)
{
cout<<("*");
}
cout<<("\n");
}
return 0;
}
Aug 16 '16 #1
2 1060
donbock
2,426 Recognized Expert Top Contributor
What is your question?
Aug 16 '16 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
Your loops work just fine. BUT you have typos that stop the compile from working and the cin you use is coded like you were using scanf.

There are other missing parenthesis an
d no method to stop the program at the end so you can see your displayed square.

Try to get this to compile. If you can't post again and I will help you through it. I'd do this for you but I already know how so that doesn't help you.
Aug 16 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5397
by: Litening | last post by:
Hi Can someone please supply me with a program (perhaps the C source) that authenticates a user on AIX (against the password/shadow/security file(s))? So far I have the following from IBM, but I don't know how to implement it (I'm not really a programmer): _______________________
4
1366
by: Philip Wagenaar | last post by:
I have a program that has to run under the administrator account. But the use that will start the program has it's own (limited) account. How can I run a program under administrator? I'd like solution that is a secure as possible. So not using run as or something on command prompt.
1
3768
by: Mircea | last post by:
Hi everybody, Sorry if this problem has been discussed, I did not find any useful information. I have one problem regarding C#. I want to run a program from a C# program as a different user. I want to provide the user name and password as parameters to the called program from C# and I don't want to be prompted for password.
2
1541
by: bryan.a.fowler | last post by:
I'm really new working with VB.net and I'm working on a simple program with a date input. I've got a couple of questions; 1) I'm using a DateTimePicker to show both the user inputted date as well as the calculated date. Is this a good way to do this or is there an easier way? 2) I can't seem to get the code right to take the user inputted date to output to the new calculated date. This is my code so far;
6
2704
by: foreverbored75 | last post by:
Hello All! I am just learning c++ in school and I have the following question: Is there a way for the user to input the length of an array (console application) without using another variable? I made this program that finds the average of x number of numbers and stores the average in the last index of the array of the numbers. The other other variable I have is to determine the length of the array (totalNums). Is there a way to get...
5
2294
by: OtheymAverian | last post by:
I am trying to call a stored SQL procedure while either passing or accepting a used inputted parameter. Currently I have a variable coded to accept the number I need to pass, but I do not know how to pass that number along with the the SQL call. My current code is as follows: Private Sub butMoveNDStoBO_Click() On Error GoTo Err_butMoveNDStoBO_Click Dim RecordNo As Long Dim SQL As String RecordNo =...
0
1859
by: rotaryfreak | last post by:
Hello, Im building a client-server application and the user needs to input the hostName and the portNumber the client application and needs to send the portnumber to the server application. I have everything set up (properly, i think) but i keep getting a connection error on the portNumber because my instantiated portNumber is 0; On the server side, when i System.out.print the portNumber, i see it is in fact 0. I know why this is happening;...
1
2029
by: Dubyer | last post by:
Hi everyone, I am taking Java for the first time(required for my degree), and I am looking for help with a program I need to create. I have searched the forums, but none of them meet the criteria that I am looking for. For my homework, I need to write a program that will roll 2 die based on the user input. The program needs to keep looping until the number of rolls has been reached. For my output, I need to display the roll number, the...
0
8628
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9054
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7785
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5884
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.