answersLogoWhite

0


Best Answer

With functions like ecvt, fcvt, gcvt.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to print float or double without using printf?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you print on console without using printf or puts in c language?

write, putchar, putc, fputc etc


Can you print string without using semi column in printf statement in c programming?

If you forget the semicolon, your program won't compile.


What is a C program to print initials?

printf ("initials");


Program to find roots of quadratic equation using switch?

include <stdio.h> #include <math.h> /* Prototypes */ void realRoots(double, double, double); void imaginaryRoots(double, double, double); int main() { /* Local variables */ int option; double a, b, c, d; printf(" Quadratic Equation ax^2+bx+c=0 \n"); printf("******************* *******************\n"); /* Print list */ printf("\n1) Real roots\n"); printf("2) Imaginary roots\n"); printf("3) Repeated roots\n"); printf("4) Exit\n"); scanf("%d", &option); printf("************* *************************\n"); /* Get a, b, and c from user */ printf("\na = "); scanf("%lf", &a); printf("b = "); scanf("%lf", &b); printf("c = "); scanf("%lf", &c); /* Calculate determinant */ d = (b * b) - (4 * a * c); /* Use switch statement */ switch(option) { /* If 1 was selected */ case 1: realRoots(a, b, sqrt(d)); break; /* If 2 was selected */ case 2: imaginaryRoots(a, b, sqrt(-d)); break; /* If 3 was selected */ case 3: break; /* If 4 was selected */ case 4: break; } /* End program */ return 0; } /* Evaluate real roots */ void realRoots(double a, double b, double d) { /* Calculate */ double firstRoot = (-b/(2 * a)) + (d/(2 * a)); double secondRoot = (-b/(2 * a)) - (d/(2 * a)); /* Print */ printf("\nFirst Real Root: \t%lf\n", firstRoot); printf("\nSecond Real Root: \t%lf\n", secondRoot); } /* Evaluate imaginary roots */ void imaginaryRoots(double a, double b, double d) { /* Calculate */ double x = 2 * a; double first_term = (-b)/x; double second_term = (d)/x; /* Print */ if(second_term >= 0) { printf("\nFirst Imaginary Root: \t%lf + %lfi\n", first_term, second_term); printf("\nSecond Imaginary Root: \t%lf - %lfi\n", first_term, second_term); }else { second_term = -(second_term); printf("\nFirst Imaginary Root: \t%lf + %lfi\n", first_term, second_term); printf("\nSecond Imaginary Root: \t%lf - %lfi\n", first_term, second_term); } }


Write a for loop in C to print the 7 stars row?

... int i; for( i = 0; i < 7; ++i ) { printf("*"); } printf("\n"); ...

Related questions

Without printf statement semicolon print the statement?

int main (void) { if(printf("Print whatever you want")) { } }


What is the significance of 'sizeof' operator in C?

size of operater - is used to print the size in byte of your data types such as(int, char, float, double etc.) depend upon your different types of data types. and compilersEXAMPLES#include#includeint main(){int i;char ch;float f;double d;long double l;printf("\nsize of integer is %d byte",sizeof(i));printf("\nsize of character is %d byte",sizeof(ch));printf("\nsize of float is %d byte",sizeof(f));printf("\nsize of double is %d byte",sizeof(d));printf("\nsize of long is %d byte",sizeof(l));getch();}Made by (ARUN KUMAR RAI).


How do you print the message without using printf and semicolon?

use cout << simple


Print 200 with and without sign?

printf("%u %+d %+d",200,200,-200); //will print 200 +200 -200


Can anyone give a logic in c plus plus to print something on screen using printf statement but without semicolon used after printf statement?

try to usecondition ? value if true : value if falseor: if (printf ("Hello")) {}


How do you print in c?

printf(format_string, ...);


What is printf function?

Printf function is used in c language. Printf is used to print something to the standard output. ex: printf ('welcome');


What are the extra uses of pointer such as print anything on the screen without using printf in c?

Your question makes no sense.


How do you print on console without using printf or puts in c language?

write, putchar, putc, fputc etc


How do you write a C program using an integer array to print array numbers up to 100 and then remove all numbers that are divisible by 2 and print out the remaining numbers and continue for 3 to 9?

#include<stdio.h> #include<conio.h> void main() { int i, a[100]; clrscr(); printf("Numbers from 1 to 100"); for(i=1;i<=100;i++) printf(" %d",a[i]); printf("Numbers from 1 to 100 without multiples of 2"); for(i=1;i<=100;i++) { if (a[i]%2 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 3"); for(i=1;i<=100;i++) { if (a[i]%3 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 4"); for(i=1;i<=100;i++) { if (a[i]%4 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 5"); for(i=1;i<=100;i++) { if (a[i]%5 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 6"); for(i=1;i<=100;i++) { if (a[i]%6 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 7"); for(i=1;i<=100;i++) { if (a[i]%7 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 8"); for(i=1;i<=100;i++) { if (a[i]%8 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 9"); for(i=1;i<=100;i++) { if (a[i]%9 !=0) printf(" %d",a[i]); } getch(); }


Why printf is used instead of print in c?

The printf() function prints a formatted string.


How do you print the distance between 2 points in c language?

void PrintDist (double d) { printf ("the distance is %g", d); }