Ps 1

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

3--------------------------

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
float temp, c;
scanf("%f", &temp);

c = ((temp-32)*5)/9;

printf("%.2f", c);

return 0;
}

-------------------------------------
2----------
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {

int a=10, b=4;


float c=4, d=2;
int x;
float y;

scanf("%d %d", &a, &b);


scanf("%f %f", &c, &d);

x = abs(a-b);
y = fabs(c-d);

printf("%d %d\n",(a+b), x);


printf("%.1f %.1f", (c+d), y);
return 0;
}

----------------------------------------

1-------
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
int x=10, y=20;
scanf("%d %d", &x,&y);
x= x+y;
y= x-y;
x= x-y ;
printf("%d %d",x,y); return 0;
}

You might also like