473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

urgent plz help me to complete assingment

7
can any one explain plz urgently

code was this
#include<stdio.h>
#include<conio.h>
void main()
{

double a=3.1428571;
int b=4347;
printf("%e\t%5d\t%5.4f\t%.5f\n",a,b,9,9);
getch();
}


--------OUTPUT-------------
3.142857e+000 4347 0.0000 0.00000
plz explain this why is the output of this function is this
Oct 17 '06 #1
4 1694
PINKA
7
can any one explain plz urgently

code was this
#include<stdio.h>
#include<conio.h>
void main()
{

double a=3.1428571;
int b=4347;
printf("%e\t%5d\t%5.4f\t%.5f\n",a,b,9,9);
getch();
}


--------OUTPUT-------------
3.142857e+000 4347 0.0000 0.00000
plz explain this why is the output of this function is this
Oct 17 '06 #2
sircool
12
can any one explain plz urgently

code was this
#include<stdio.h>
#include<conio.h>
void main()
{

double a=3.1428571;
int b=4347;
printf("%e\t%5d\t%5.4f\t%.5f\n",a,b,9,9);
getch();
}


--------OUTPUT-------------
3.142857e+000 4347 0.0000 0.00000
plz explain this why is the output of this function is this
if you select %e formatted that means you wanna print that floating point numbers format that save memory because of floating points.
3.142857e+000 that output means there isn't any sliding point i mean that if there is written -01 after 'e' the real number would be occur when you slide the point one time to left the following example will make clear
3.142857e+000=0.3142857e-01
if the operator is '+' you need slide the dot right written times(after e)

the following wrong is that
printf("%e\t%5d\t%5.4f\t%.5f\n",a,b,9,9);
i am not sure but i think the problem is that you wrote a number that in order to object...
Oct 17 '06 #3
Banfa
9,065 Expert Mod 8TB
can any one explain plz urgently

code was this
#include<stdio.h>
#include<conio.h>
void main()
{

double a=3.1428571;
int b=4347;
printf("%e\t%5d\t%5.4f\t%.5f\n",a,b,9,9);
getch();
}


--------OUTPUT-------------
3.142857e+000 4347 0.0000 0.00000
plz explain this why is the output of this function is this
it is all related to the format specifiers you are giving in the printf string, these are

%e
%5d
%5.4f
%.5f

and you pass in for these specifiers

double a=3.1428571;
int b=4347;
integer constant 9
integer constant 9

respectively. Taking the triples (format string, value, output)

3.142857e+000, %e, double a=3.1428571;

a is a floating point variable of type double with the value 3.1428571, %e indicates the printf to expect a floating point value and to print it out in exponential format therefore printf outputs 3.142857e+000

4347, %5d, int b=4347;

b is and integer variable with the value 4347, %5d indicates to printf to expect an int and to output it in a field of size 5 (i.e. 5 characters wide), therefore printf outputs ' 4347'.

0.0000, %5.4f, integer constant 9

integer constant 9 is an integer constant value 9, unfortunately %5.4f indicates to printf to expect a double value since int is normally 2 or 4 bytes and double is 8 bytes printf f consumes both the first and second integer constant 9 and interprets them as a double (this appears to have value 0 or alternatively is not representable) there printf outputs '0.0000' note it has followed the specification of 4 decimal places but ignore the specification of field with 5, it is impossible to fit 4 decimal places into a field width of 5.

0.00000, %.5f, integer constant 9

actually this integer constant has already been consumed by printf, at this point it is just reading random stack data it is just sheer fluke that the value is 0. %.5f indicates to printf to expect a double and print it using 5 decimal places so it outputs 0.00000
Oct 17 '06 #4
Banfa
9,065 Expert Mod 8TB
Please don't double post
Oct 17 '06 #5

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

Similar topics

1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
0
by: Anurag Saxena | last post by:
If someone can solve this problem,I am using ASP3.0 and IIS on windows 2000 server The complete Error is '''''''''''''''''''''''''''''''''' Server object error 'ASP 0177 : 800401f3' ...
1
by: Anurag Saxena | last post by:
If someone can solve this problem,I am using ASP3.0 and IIS on windows 2000 server The complete Error is '''''''''''''''''''''''''''''''''' Server object error 'ASP 0177 : 800401f3' ...
3
by: Peter | last post by:
I have asp.net code using C# that will convert tif file into jpg and then it display them. The program works on my machine and Dev machine with Window XP professional. When I deploy the program on...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
0
by: fireline1082 | last post by:
Hi every body I am doing a project in which I have a Windows Certificate Authority server and RADIUS server (IAS RADIUS server under windows ) . In this project the clients will login to the...
0
by: okonita | last post by:
Hi all, I am running a recover tocopy procedure and twice with different image copy I found this informational message AND no data recovered: DSNUCBAL - THE IMAGE COPY DATA SET...
77
by: Hans Schneider | last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); }
1
by: toskg | last post by:
I am seeking an Urgent Help from all my seniors and experts to complete my assignment. I am doing a Project for Multi-Level Marketing(MLM) Co. Website using ASP (DreamWeaver 8.0) and MS-Access as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.