I don't like it how nobody found this funny. Where is your sense of humor? :)
This code isn't working, I'm positive :)
Type: Posts; User: Junky
I don't like it how nobody found this funny. Where is your sense of humor? :)
This code isn't working, I'm positive :)
I understand now. I was confused, because CTRL-Z gave me "^Z", but I just have to press enter. Tnx
Ok, I'm getting really annoying with this, but I want to understand EOF completely.
#include <stdio.h>
int main() {
int c,nl;
nl = 0;
while ((c = getchar()) != EOF) if (c...
Omg, you're right!!
Tnx :)
Windows XP, I'm working on Dev-C++.
Thanks, I think I understand now what does it actually do. I realized that it prints "Lol\n" 1 time if I just press "Enter", 2 times if I enter 1 character, 3...
Tnx, it doesn't work for CTRL D/Z, but it works for CTRL C :)
One more question, but I don't want to open a new thread. The author said that you can do this:
#include <stdio.h>
int main() {...
I was reading a book about C programming, and I came across this program example:
#include <stdio.h>
int main() {
int c;
c = getchar();
while (c != EOF) {
It will work fine without the loop, you just did something else wrong.
I wanted to do a program with concatenating strings 'strcat()', where this function accepts two strings, but the second must be a constant string. This is a problem, because if I need more than 1...
Well, yes. The loop should go from the number (x from x!) down to 1.
But I don't get why you did this:
int maxfactorial=0, minfactorial=0, line=0, factorial=0, i=0;
...
I mostly understood what you said, tnx for explaining :)
Do you know if perhaps there is a way to do this correct? Is there a way to get a correct number with digits "abcd" from "0.abcd" (a way to...
I just saw that if I put x as float instead of double (and scanf("%lg",&x) -> scanf("%f",&x)) it works fine.
But doesn't double have more precision than normal float?
Tnx for the explanation.
Ok, sorry, i didn't mean to be rude.
I have x = 0.168, and I multiply it with 1000 (x *= 1000), and I get x = 186, but int(x) = 185.
But it compiles to me. I don't understand...
#include <stdio.h>
#include <stdlib.h>
int main(void) {
double x; int i;
scanf("%lg",&x);
for (i = 1; i <= 4; i++) {
x *= 10;
printf("x = %lg\n",x);