Message from C, C++ talks

June 2019

— Https://

— Shaders in 80s be like … 😂

— Hi friends...

— Can I get more on system programming with C on wondows?


#include <stdio.h>

void swap(int* x, int* y){
int temp = *x;
*x = *y;
*y = temp;

int main(){
int x = 10;
int y = 20;
/* Before swapping */
printf("x is %d, y is %d\n", x,y);
swap(&x, &y);
/* After swapping */
printf("x is %d, y is %d\n", x, y);

return 0;

Should work fine now;

— /report

— Reported Harmlexx to admins.​​​​​​​​​​​​

— Read books!


— Why is the double in the decimal not showing?

— It outputs an integer value

— Ive put iomanip and changed the double to float but still the decimal of the percentage wont appear

— /rules

— Click on the button to see the chat rules!

— You should write (float) before an expression.
Correctly it would look like
float percent = (float)(votes[i]*100)/sum;

Message permanent page