473,749 Members | 2,626 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I am trying to run a program on C and I'm not sure how to start the for loops.

2 New Member
The output should look like this:

This program will print a character diamond.
Enter a character: 6
Enter an odd number at least 1 but less than 40: 15
6
67876
6789:9876
6789:;<;:9876
6789:;<=>=<;:98 76
6789:;<=>?@?>=< ;:9876
6789:;<=>?@ABA@ ?>=<;:9876
6789:;<=>?@ABCD CBA@?>=<;:9876
Sep 28 '16 #1
3 1067
cameronmcisaac
2 New Member
The output is suppose to look more like a pyramid and not a right triangle.
Sep 28 '16 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
Draw it again. You can use periods as spaces so I can see what you want to do.
Sep 28 '16 #3
donbock
2,426 Recognized Expert Top Contributor
You should draw the desired output inside Code tags so that Courier font is used (all characters are the same width).
Sep 28 '16 #4

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

Similar topics

2
3504
by: Dave Reed | last post by:
I seem to remeber reading somewhere there was a statement you could put in your python program to stop its execution and start the interactive interpreter at that point (and then you could change the value of some variables and continue executing). Am I having delusions or is there a way to do this? Thanks, Dave
1
2269
by: RWC | last post by:
Hello, I have just converted a database from A97 to A2K2. I had a procedure for changing start up properties that worked really well. For some reason, they don't work in A2K2 and I'm having a tough time finding out what the "replacement values" are. These are the items I'm trying to change; ChangeProperty "AllowSpecialKeys", dbBoolean, True ChangeProperty "AllowByPassKey", dbBoolean, True ChangeProperty "StartUpShowDBWindow",...
1
5348
by: cashdeskmac | last post by:
I want to offer uswers the chance to add my program to their startup when they install it. I don't mean the Start Up menu, but instead to have it listed in msconfig and start up automatically when the computer does. Can anyone help ?
3
1480
by: JN | last post by:
Hello, I am trying to write a program or service that will run in the background and wait for a particular program to start, when it does I want something else to occur such as a message box. I am not sure how to do the waiting game (sleep is no good, neither is a loop). Any help is appreciated. JN
5
2462
Reika
by: Reika | last post by:
Hello, I need help understanding some things in programming. I'm taking a high school level programming course, however my teacher is less than helpful in explaining or even understanding the assignments he gives us himself. I'm unsure what version of Codewarrior we use, but its Metroworks Codewarrior, Windows not mac, and this is in C++. My first problem is understanding how to use nested for loops in order to display a (crooked) diamond...
6
3482
by: gopython | last post by:
Hi all, OS: Windows XP C++: Microsoft Visual C++ 2005 I am wondering if it is possible to kill the C++ program after calling another program (i.e. .bat). I did a simple test and check the "Windows Task Manager". After the exe run the .bat the exe is still there until the .bat finished running. Is that possible to kill the .exe after the .bat is called. // Filename:test.cpp #include <iostream>
3
1394
by: aplata | last post by:
I am trying to understand the following code: my @arr1=(5,3,2,1,4); my $i=0; my $j=0; $tmpnum for($i=0;$i<@arr1;$i++) { for($j=0;$j<@arr1;$j++) { if($arr1<$arr1) { $tmpnum=$arr1;
1
1267
by: William Chavula | last post by:
void basic() { cout<<"---FOLLOW THESE STEPS TO DIAGNOSE INTERNET PROBLEMS---\n\n"; cout<<"---STEP 1---\n\n"; cout<<"Run your mobile partner software\n\n"; cout<<"---STEP 2---\n\n"; cout<<"Click on TOOLS in the menu bar\n\n"; cout<<"---STEP 3---\n\n"; cout<<"In the tools menu click on PROFILE MANAGEMENT\n\n";
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9568
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...
1
9335
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
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6801
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
6079
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
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
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.