answersLogoWhite

0


Best Answer

You can certainly do that ...

printf ("This is a number: 12345\n");

... but that does not have the same value as placing the value in a variable and converting the variable into a string ...

int i = 12345;

printf ("This is a number: %d\n", i);

That's the whole point of format specifiers - to initiate a conversion from one place to another.

User Avatar

Wiki User

โˆ™ 2012-03-28 22:35:11
This answer is:
User Avatar
Study guides

Data Science

โžก๏ธ
See all cards
4.17
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
6 Reviews

Add your answer:

Earn +20 pts
Q: Why not you simply put the decimal integer into the original string as compared to the format specifier?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the format specifier of short integer?

%hd


What is the purpose of the format specifier?

There are many types of format specifier. Exp:%d (To show the integer) %c(To show the character) %f(Float are digits with decimal points to use it to show them) %s(String to show the string)


Can you declare printf for integer variable?

printf is declared in stdio.hFormat specifier for an integer value is %d.


Why not simply put the decimal integer into the original string as compared to the format specifier?

You can certainly do that ... printf ("This is a number: 12345\n"); ... but that does not have the same value as placing the value in a variable and converting the variable into a string ... int i = 12345; printf ("This is a number: %d\n", i); That's the whole point of format specifiers - to initiate a conversion from one place to another.


What are the list of modifier in turbo c language?

%c The character format specifier.%d The integer format specifier.%i The integer format specifier (same as %d).%f The floating-point format specifier.%e The scientific notation format specifier.%E The scientific notation format specifier.%g Uses %f or %e, whichever result is shorter.%G Uses %f or %E, whichever result is shorter.%o The unsigned octal format specifier.%s The string format specifier.%u The unsigned integer format specifier.%x The unsigned hexadecimal format specifier.%X The unsigned hexadecimal format specifier.%p Displays the corresponding argument that is a pointer.%n Records the number of characters written so far.%% Outputs a percent sign.Provided that 'modifier' means 'format specifier'.


Why we use percent you in c language?

%u is a printf format specifier that says to take the next argument and display it as an unsigned decimal number, assuming standard integer length.


Is a decimal number an integer?

A decimal number is not an integer. An integer is a number that is not a fraction, and decimal numbers are decimal fractions.


Is a none repeating decimal an integer?

No, if it has a decimal place then its not an integer


How do you divide an integer by a decimal?

By using a calculator, enter: (integer) / (decimal)


Can a negative decimal be an integer?

an integer won't have any decimal point


Would a decimal be an integer?

No by definition a decimal number can never be an integer because an integer is a whole number (it can not have any decimal parts).


Is a terminating decimal an integer?

No. An integer has NO digits (or NO nonzero digits) after the decimal point.

People also asked