This is the code I have so far. I want it to print it in different order like you can probably see below. But when I actually see the results it gives me different numbers. It gives me this after I type 10 numbers in...2293620 22935842293616 22935882293612 22935922293608 22935962293604 2293600
Here is my code so far maybe you guys can tell me what I did wrong... -
-
#include <stdio.h>
-
-
int main (void)
-
{
-
// Local Declarations
-
int a;
-
int b;
-
int c;
-
int d;
-
int e;
-
int f;
-
int g;
-
int h;
-
int i;
-
int j;
-
-
// Statements
-
printf("Please enter 10 numbers\n");
-
scanf("%d %d %d %d %d %d %d %d %d %d",&a,
-
&b,&c,&d,&e,&f,&g,&h,&i,&j);
-
printf("%3d %3d",&a,&j);
-
printf("%3d %3d",&b,&i);
-
printf("%3d %3d",&c,&h);
-
printf("%3d %3d",&d,&g);
-
printf("%3d %3d",&e,&f);
-
-
return 0;
-
} // main
-
-
-
1 1180
This is the code I have so far. I want it to print it in different order like you can probably see below. But when I actually see the results it gives me different numbers. It gives me this after I type 10 numbers in...2293620 22935842293616 22935882293612 22935922293608 22935962293604 2293600
Here is my code so far maybe you guys can tell me what I did wrong... -
-
#include <stdio.h>
-
-
int main (void)
-
{
-
// Local Declarations
-
int a;
-
int b;
-
int c;
-
int d;
-
int e;
-
int f;
-
int g;
-
int h;
-
int i;
-
int j;
-
-
// Statements
-
printf("Please enter 10 numbers\n");
-
scanf("%d %d %d %d %d %d %d %d %d %d",&a,
-
&b,&c,&d,&e,&f,&g,&h,&i,&j);
-
printf("%3d %3d",&a,&j);
-
printf("%3d %3d",&b,&i);
-
printf("%3d %3d",&c,&h);
-
printf("%3d %3d",&d,&g);
-
printf("%3d %3d",&e,&f);
-
-
return 0;
-
} // main
-
-
-
You are passing the pointer to the integers.
Try using:
printf("%3d %3d",a,j);
(and likewise) instead
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Thomas Weholt \( PRIVAT \) |
last post by:
I've got a rather small project, small in the sense that there's not a lot
of different tables needed in the database/storage-system, but there will be
alot of data and the clients must be able to scan thru huge amounts of data
very fast ( Not serial scanning, but lookups by key, preferrably several
keys pr record, ie. I need to lookup people both by SSN and by
first/last-name etc. )
So far I've used MySQL, mainly because I need...
|
by: Nickolay |
last post by:
it's easy to create small executable from python code, when using
assembler compilers. I ask you if need it?
|
by: Sharon |
last post by:
Hiya
I have a small question, I saw this piece of code somewhere (it's for
creating a customized context menu) and I was wondering: Why is it
that the STYLE and SCRIPT-tags are broken up into parts? I hope
someone can answer my question, thanks! Sharon
html+='<TABLE STYLE="border:1pt solid #808080" BGCOLOR="#CCCCCC"
WIDTH="140" HEIGHT="220" CELLPADDING="0" CELLSPACING="1">';
html+='<ST'+'YLE TYPE="text/css">\n';
html+='a:link...
|
by: Tim |
last post by:
Hi Group,
Apologies if this is a bit OT (if so, please advise where it should be
posted).
I was wondering if anyone had any ideas as to what applications could
work in a system where the server has a large storage and fast
processing speed, but the client is connected via a small bandwidth?
Assuming many clients could be connected simultaneously.
|
by: Geoff Cox |
last post by:
Hello
Would be grateful if someone can make a few things clear for me!
I have developed a small app using Java and would like to do the same
using C++ but without the need for a runtime environment addition.
This is a very samm app and it seems foolish to have to ask the user
to install 20 MB of extra software.
The app displays an image and a question asks the user to indicate
| |
by: Gena |
last post by:
Hi ,
I'm a newbe to programming and have a small question:
I made a small program with a class. in the class's header file I have
: double *ptr_output;
Void main()
{
double result;
|
by: =?Utf-8?B?VzFsZDBuZTc0?= |
last post by:
When one architects a new project one of the first steps in the decision is
to decide on the layers. (In my opinion anyway)
One architecture that I have used before is to go solid OO and create
objects, which normally are very small and only deals with the stuff
pertaining to that object, then break it down into Business Process, Process
Controllers and Data Access Objects for each "Object", each of which is
created in it's very own .Net...
|
by: =?Utf-8?B?cmJiZW5zb24=?= |
last post by:
To begin,, the network infactructure-
Servers -
Server00 - Windows Server 2003/Installed
Server01 - Windows Server 2003/plan to install
Server10 - Linux RedHat Workstation/Installed
Client/Workstations -
Client 00 - Windows XP Pro/Installed
Client 01 - Windows XP Home/Installed
|
by: JohnQ |
last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post).
It would be more than a little bit nice if C++ was much "cleaner" (less
complex) so that it wasn't a major world wide untaking to create a toolchain
for it. Way back when, there used to be something called "Small C". I wonder
if the creator(s) of that would want to embark on creating a nice little
Small C++ compiler devoid of C++ language features that make...
|
by: mbatestblrock |
last post by:
I know this is a completely out there question with a million open ended questions. I was just hoping I could get a round about answer...
Using a basic form: EX: name, address, phone number. etc etc. Access 2007 is able to export to excel of or text document from the main menu, and with using VBA is able to merge with a words doc... I was wondering if using some VBA script can the info in any given basic form be merged into a Microsoft...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |