Anonymous
How do I get this solve.
/warn screen photo
Ilya
This which one should i use?
Turbo c was outdated 20 years ago. Use modern compilers.
Anonymous
/warn
Kenji
How can I compile an app for x86-16 (such as 8086, 80286) with a modern C++ compiler (I think a modern C++ compiler should support at least C++11.). (I know I can use OpenWatcom to compile 16-bit apps, but that compiler don't support C++11.)
Anonymous
There are plenty of them
Kenji
thanks
Anonymous
#include<stdio.h> int main() { int n,i=3,c,count; printf("\n Enter the number:"); scanf("%d,&n"); if(n>=1) { printf("\n Prime Numbers"); printf("2"); } for(count=2;count<=n;count++) { for(c=2;c<=i;c++) { if(i%c==0) break; } if(c==i) { printf("%d",i); count++; } } return 0; } Can anyone make me understand this code ?
数学の恋人
void foo( FILE * stream ) ....
Isn't that C thing?
数学の恋人
Understand? I can’t even read it.
Lol he/she deserves a warn
Anonymous
Lol he/she deserves a warn
Which rule the person violated?
Tushar khanna
#include<stdio.h> int main() { int n,i=3,c,count; printf("\n Enter the number:"); scanf("%d,&n"); if(n>=1) { printf("\n Prime Numbers"); printf("2"); } for(count=2;count<=n;count++) { for(c=2;c<=i;c++) { if(i%c==0) break; } if(c==i) { printf("%d",i); count++; } } return 0; } Can anyone make me understand this code ?
#include<stdio.h> int main() { int n,i=3,c,count; printf("\n Enter the number:"); scanf("%d,&n"); if(n>=1) { printf("\n Prime Numbers"); printf("2"); } for(count=2;count<=n;count++) { for(c=2;c<=i;c++) { if(i%c==0) break; } if(c==i) { printf("%d",i); count++; } } return 0; } You should send code like this .
Anonymous
But definitely better
Tushar khanna
Ya I know I just arranged in hurry
Anonymous
Can anyone make me understand this ?
Anonymous
Can anyone make me understand this ?
What don't you understand?
Anonymous
Anonymous
well, actually it is not working, but it is up to you to find out why
Anonymous
The code itself
No, that's not how it works
Anonymous
You need to ask more specific questions
Anonymous
Alright thank you, with all due respect.
Ибраги́м
Ya I know I just arranged in hurry
Or u can just put it in an IDE and Style it.
数学の恋人
It is.
then any other way?
Ilya
then any other way?
Any other way what? I've lost the idea of discussion
数学の恋人
but in C++
Raz
but in C++
You can use std::ifstream for opening a file, and std::cin for reading from stdin
Ilya
yep
But you asked for stdout, it is C
Anonymous
but in C++
Why? if there is a such good lang as Go?
Raz
You can use std::ifstream for opening a file, and std::cin for reading from stdin
istream* I dont think we can open std::cin as std::ifstream
数学の恋人
数学の恋人
In go we can, but not in C++
数学の恋人
I see
Ilya
but in C++
You can do something like void foo( std::istream& in );
数学の恋人
let me try that real fast
数学の恋人
http://dpaste.com/1M9P4QP
数学の恋人
http://dpaste.com/1M9P4QP
what's wrong in that?
数学の恋人
http://dpaste.com/1M9P4QP
no matching function for call to 'out'
olli
no matching function for call to 'out'
stdin is of type FILE* if you want to use istream& you should pass std::cin https://en.cppreference.com/w/cpp/io/cin
Anonymous
hi guys could someone help me with this loan program
Anonymous
Anonymous
the result came out but printout the wrong output since the formula is wrong
Anonymous
Share your code with paste.ubuntu.com
Anonymous
Share your code with paste.ubuntu.com
https://paste.ubuntu.com/p/Y5gdvqZPKH/
Ilya
what's wrong in that?
stdin is a C-runtime object of type FILE*. C++'s stdin is called std::cin You must choose what you use, which IO, of C or of C++ and then use only one.
Ilya
Publish your code on pastebin.com or similar
Anonymous
Publish your code on pastebin.com or similar
https://paste.ubuntu.com/p/Y5gdvqZPKH/ done that...tq for reminder 😁
Ilya
the result came out but printout the wrong output since the formula is wrong
These expressions in printf are valid, but semantically useles printf("\t%.2f\t\t\t%.2f\t\t\t%.2f\n", AIR, P= P= (r*LoanAmount)/(1- pow(1+r,-N)), TP=P*N); try rewriting the statement.
Anonymous
These expressions in printf are valid, but semantically useles printf("\t%.2f\t\t\t%.2f\t\t\t%.2f\n", AIR, P= P= (r*LoanAmount)/(1- pow(1+r,-N)), TP=P*N); try rewriting the statement.
I see, sorry for the double P= typo inside the coding, even without it the result is the same, but the the P= is supposed to be write like below pic
Anonymous
Anonymous
even without p = p = .... (that is , p = ... ) this would be very strange.
I see, sorry I'm not good when it come to math statement writing, nevermind I'll try to fix that up, tq for point of the mistake though 😁 appreciate it
Ilya
I see, sorry I'm not good when it come to math statement writing, nevermind I'll try to fix that up, tq for point of the mistake though 😁 appreciate it
It is not problem of math, you just do something you don't understand. Try re-writing all this program removing all unnecessary variables and statement.
Ilya
I see, sorry I'm not good when it come to math statement writing, nevermind I'll try to fix that up, tq for point of the mistake though 😁 appreciate it
The formula for P is actually OK. You also must know what UB is, you have it in the code. You cannot calculate a variable and use it in the same full expression for other subexpression. Put variables assignments outside PRINTF call.
NEN
Dear all of you I am bunly
Anonymous
Hi everyone
Nameful
program more, read more source code
Anonymous
Thank you
Dima
get a job lol
Anonymous