Anonymous
I would not go with c# at all, it has bigger binary sizes, is slower, it also forces oop down your throat. for cp I would just stick with c++.
Anonymous
for cp you do not want a bunch of overhead or boilerplate both of which c# brings
Mar!o
C++ is fine for CP but remember that most code written for CP is shit code
Anonymous
Boa noite
Anonymous
Boa noite
/warn non English
Ronny
Thanks a lot Rose
Ronny
I want to be a good c++ programmer
Yuichi
hi everyone
Yuichi
Can u check my game(demo) and tell me about problems with physics? - https://github.com/YuichiKamishiro
Yuichi
meybe u need dep sudo apt-get install libsfml-dev
Anonymous
/report
Anonymous
hey i am doing c language on vs code
Anonymous
my code is #include<stdio.h> void main() { int r; float a; printf("enter the radius of circle :\n"); scanf(" %d",&r); a=3.14*r*r; printf("s %f s the area",&a); }
Anonymous
why are you using a pointer to a in printf
Anonymous
the output is -1.#QNAN0 s the area
Anonymous
yes
Anonymous
&a should just be a
Adarsh
&a will print address of a
Anonymous
oh ! sorry to disturb, i got the answer
Anonymous
&a should print some weird formatted thing that represents the memory address of a
Anonymous
RTFM.
Errors: 759650702/source.java:1: error: illegal character: '#' #include<stdio.h> ^ 759650702/source.java:1: error: class, interface, or enum expected #include<stdio.h> ^ 759650702/source.java:5: error: class, interface, or enum expected float a; ^ 759650702/source.java:6: error: class, interface, or enum expected printf("enter the radius of circle :\n"); ^ 759650702/source.java:7: error: class, interface, or enum expected scanf(" %d",&r); ^ 759650702/source.java:8: error: class, interface, or enum expected a=3.14*r*r; ^ 759650702/source.java:9: error: class, interface, or enum expected printf("s %f s the area",&a); ^ 759650702/source.java:10: error: class, interface, or enum expected } ^ 8 errors Tip: Mistake? Edit your message, I'll adjust my response.
Anonymous
that is a java file
Anonymous
source.java
Anonymous
what's the difference between Mingw and GNU compilers?
.
Good question
Pooja
What is the difference between &a and &&a?
Andrew
What is the difference between &a and &&a?
https://www.tutorialspoint.com/cprogramming/c_operators.htm
Adarsh
/get cbook
Adarsh
Can we optimize this code? #include<iostream> using namespace std; #define MAX 200 void fact(int n) { int arr[MAX]; arr[0]=1; int arrSize=1; for(int x=2;x<=n;x++) { int carry=0; for(int i=0;i<arrSize;i++) { int product = arr[i]*x+carry; arr[i]=product%10; carry=product/10; } while(carry) { arr[arrSize]=carry%10; carry=carry/10; arrSize++; } } cout<<"Factorial :"; for(int i=arrSize-1;i>=0;i--)cout<<arr[i]; } int main() { fact(5); return 0; }
Hariyana Grande
#include<stdio.h> int main(){ int glob=20; { extern int glob; printf("%d",glob); } printf("%d", glob); return 0; }
Hariyana Grande
its giving error why?
Hariyana Grande
do we need to declare ext outside main?
Anonymous
its giving error why?
Because your code doesn't make sense
Anonymous
Don't use something you don't understand
Hariyana Grande
how do you learn if you dont try different things
Eturnus
#include<stdio.h> int main(){ int glob=20; { extern int glob; printf("%d",glob); } printf("%d", glob); return 0; }
#include<stdio.h> extern int glob=0; int main(){ glob=20; printf("%d\n",glob); printf("%d", glob); return 0; }
Hariyana Grande
these type of problems are common in multiple choice tests
Eturnus
yes
Hariyana Grande
#include<stdio.h> extern int glob=0; int main(){ glob=20; printf("%d\n",glob); printf("%d", glob); return 0; }
there are 4 options given a) 0 0 b) 0 20 c)20 0 d) linker error for the program i posted what do u think might be the answer then?
Eturnus
because glob=20; initialized in program
Hariyana Grande
yes that i know now but what about original program
Hariyana Grande
what is the right ans there
Eturnus
your program not gonna run
Hariyana Grande
linker error
Eturnus
as extern variable not defined
Hariyana Grande
so out of 4 options linker error thanks
.
What's the diference between c and holy c?
Anonymous
What's the diference between c and holy c?
HolyC is a variation of C developed by Terry A. Davis.HolyC is the official programming language for The Temple Operating System (TempleOS). The official HolyC documentation is provided with TempleOS.
Papa
#include<iostream> using namespace std; int main() { int n=10; int arr[10]; for(int i=0;i<n;i++) { if(i%2==0) { arr[i]==0; } else; { arr[i]==1; } cout<<arr[i]<<endl; } }
Papa
what is the problem in this code
Papa
the question of this problem is Write the code that fills the elements with an even index with integer 0 and the elements with an odd index with integer 1 using the following declaration
Anonymous
Lol
Really
Oumer
ok ,then what to put
Nothing just delete semi colon
Anonymous
Really
What really? Why did you join this group if you don't know how C++ looks like?
Papa
Nothing just delete semi colon
output that i am getting is wrong
Papa
1 0 4254409 0 0 0 50 0 0 0
Papa
this is the output
Anonymous
1 0 4254409 0 0 0 50 0 0 0
Result: 2 0 -721527456 21979 1 0 -723625139 21979 -342541920 32638
Anonymous
1 0 4254409 0 0 0 50 0 0 0
You don't initialize array, and doesn't assign to its element values