Anonymous
Linklist
Hakker
👍👍
Anonymous
😂😂😂
BinaryByter
else, you can try to code some test exercises
Anonymous
Tomorrow is my exam on C++ . Please provide me videos and links that will help me to score good marks .
Good luck with that one :) The video material only will take longer than one day. Hope you have already made some solid knowledge
Anonymous
How can I minimize stack overflow condition?
BinaryByter
you put less stuff ontp the stack
Anonymous
BinaryByter
Nope
BinaryByter
buy yourself a bigger stack
Anonymous
buy yourself a bigger stack
This will result in expensive use of space if there are few elements in stack
BinaryByter
kek'd
Bruce
#include<stdio.h> int main() {int T,N,i,f,l; scanf("%d",&T); int a[T],b[T]; for(i=0;i<T;i++) {scanf("%d",&N); a[i]=N; } for(i=0;i<T;i++) {f=a[i]%10; if(a[i]/10==0) {l=0;} else { while (a[i]>10) {l=a[i]/10; a[i]=a[i]/10;}} b[i]=f+l;} for(i=0;i<T;i++) {printf("%d\n",b[i]); } } The above program is to print the sum of first and last digit of given input number,for given input test cases I did get my out put correct for my input,but in an online contest it showed wrong ans ,are there any cases where it fails
Bruce
At least format it
#include<stdio.h> int main() { int T,N,i,f,l; scanf("%d",&T); int a[T],b[T]; for(i=0;i<T;i++) { scanf("%d",&N); a[i]=N; } for(i=0;i<T;i++) { f=a[i]%10; if(a[i]/10==0) {l=0;} else { while (a[i]>10) {l=a[i]/10; a[i]=a[i]/10; } } b[i]=f+l; } for(i=0;i<T;i++) {printf("%d\n",b[i]); } } Now is it ok?
Bruce
The above program is to print the sum of first and last digit of given input number,for given input test cases I did get my out put correct for my input,but in an online contest it showed wrong ans ,are there any cases where it fails
Gianmarco
Hi guys, i ve a question: i tried to create a little program in C for train myself for the test. If i run the project through my IDE it works like a charm, when i run It through the compiled .exe It doesnt work anymore
Gianmarco
My program writes on a file "password.txt", when i run from IDE the file .txt its created, when i run from .exe It creates a file named "filename" 0kb
klimi
Weird indeed
Gianmarco
I tried with 2 different IDE but with same results
S.
What's the path you wrote for fopen
S.
( show the code please
Gianmarco
Ok i have It on my desktop PC, i have to upload It online?
S.
Ok i have It on my desktop PC, i have to upload It online?
No necessarily but only with this info it's difficult to guess the problem
Gianmarco
https://pastebin.com/VtVLQ5uz
S.
fp = fopen("fileName", "a"); if((fp = fopen(fileName, "a")) == NULL) { printf("errore in apertura!\n"); exit(1); }
S.
Look at this carefully
S.
"fileName" vs. fileName
Gianmarco
Oh...
Gianmarco
I m checking
Gianmarco
I deleted the " " in filename
Gianmarco
But now It doesnt create anything
Anonymous
Try with this input 1 10
Output must be 1 bt according to code it is coming 0
olli
Output must be 1 bt according to code it is coming 0
Exactly (actually it's undefined because you never set l in this case)
Gianmarco
guys if i have my .exe how can i make it execute a part of code only the first time it opens?
olli
Olliiii What up :D
Hey! getting ready for work and reading the core coroutine proposal (again) :D You?
CM
Output must be 1 bt according to code it is coming 0
substitute with 1 on 0. it will give 1
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Maybe lol
CM
Bt for input 1 100
maybe if you can tell your intention on this program
Alex
## Rules #pinned * You are not entitled to an answer, getting angry about not answered questions will get you warned. * Not checking your problem in google (or any other search engine) first will get you a warn. * Asking for something that is in the pinned message right after joining WILL GET YOU BANNED. * C/C++ discussion preffered (assembly also allowed), asking about other languages (or groups for other languages) right after joining will get you BANNED. * Reverse enginnering, hacking and related topics are allowed, but asking to hack facebook, instagram, etc. is NOT allowed. Also if you ask "how to become a hacker" and obviously have zero knowledge on anything related to that you may get warned or banned. * Legitimate requests for help on code and programming questions are welcome. A request is considered legitimate if it describes your problem, what you've done so far and what went wrong. Requests such as "write my program" or "do my homework" are never considered legitimate. Asking not legitimate questions will result in a warn or ban. See https://stackoverflow.com/help/mcve on how to write good questions. * Asking for book recommendations is ok, but "pls give pdf book" is not allowed, find books by yourself. Posting illegally copied books (or links to those books) is also not allowed. * Only English language is allowed, if you speak shitty English or don't understand anything in English YOU WILL BE BANNED. * A little bit of programming related memes, jokes, shitposting are allowed. * NSFW content (porn, nudity, etc.) is not allowed. * Spamming/advertising (job posts are also ads, so ask an admin before posting) will grant you a warning or an immediate ban if you do it right after joining. * Religion, politics and ideological topics are forbidden. * Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed. * If you encounter a problem, while using turbo C++, you will not be helped, use another more modern IDE. * Don't post compiled executables, that is obviously a security risk ## Resources About asking good questions: * [English](http://www.catb.org/esr/faqs/smart-questions.html) * [Translations](http://www.catb.org/esr/faqs/smart-questions.html#translations) For posting long code snippets: * [GitHub Gist](https://gist.github.com) * [Ubuntu Paste](https://paste.ubuntu.com/) * [Pastebin](https://pastebin.com) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
loving the rules ❤️ Also, hello everyone, I am a newbie starting from zero living in Milan, Italy.
CM
Anonymous
maybe if you can tell your intention on this program
I think the condition is while loop through which the last digit of the number is obtained is incorrect It should be:-- while(a[i] >1)
CM
I think there is something not declared there because its giving one answer for all values
Dima
welcom
Alex
cout « "Thanks everyone"
klimi
Welcome
Shreyash
Hii
klimi
Hi
MᏫᎻᎯᎷᎷᎬᎠ
Hi
klimi
Welcome
Gokul Rangaraju
Hai
klimi
Hi
Hakker
how to setup jetbrains clion
Dima
LOL
Hakker
i'm unable to compile, i have installed compiler
MᏫᎻᎯᎷᎷᎬᎠ
Hakker
w8 i show u error
Alex
MᏫᎻᎯᎷᎷᎬᎠ
Okay