-
as seen on Stack Overflow
- Search for 'Stack Overflow'
#include<stdio.h>
#include<conio.h>
main()
{
int ones,tens,ventoteen, myloop = 0;
long num2,cents2,centeens,cents1,thousands,hundreds;
double num;
do{
printf("Enter a number: ");
scanf("%lf",&num);
if(num<=10000 || num>=0)
{
if (num==0)
{
printf("\t\tZero");
}
num=(num*100);
num2=…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use:
printf("%1.3f", 359.01335);
printf("%1.3f", 359.00999);
I get
359.013
359.010
Instead…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello, is there a way to get with printf colored output?
#!/usr/bin/perl
use warnings;
use strict;
use Term::ANSIColor;
printf "%4.4s\n", colored( '0123456789', 'magenta' );
Output: (only newline)
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
#include<stdio.h>
int main()
{
printf("He %c llo",65);
}
Output: He A llo
#include<stdio.h>
int main()
{
printf("He %c llo",13);
}
Output: llo. It doesnt print He.
I can understand that 65 is ascii value for A and hence A is printed in first case but why llo in second case…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
i have been trying this code.
i think the logic is ok but the program terminates abruptly when the display_rev function is called
here is code of display_rev
void display_rev(emp_node *head) {
emp_node *p=head, *q;
while(p->next != NULL)
p=p->next;
while(p!=head || p==head){
…
>>> More