pointer in c October 28, 2022 #include <stdio.h>void update(int *a,int *b) { int m=*a,n=*b,i=2; *a=*a+*b; if(m>n) *b=(m-n); else *b=(m-n)+(-i)*(m-n);}int main() { int a, b; int *pa = &a, *pb = &b; scanf("%d %d", &a, &b); update(pa, pb); printf("%d\n%d", a, b); return 0;} Share Get link Facebook X Pinterest Email Other Apps Share Get link Facebook X Pinterest Email Other Apps Comments
example of typecasting in c July 18, 2020 /*Type Casting in C Typecasting allows us to convert one data type into other. */ //simple example to cast int value into the float. #include <stdio.h> int main (){ float f = ( float ) 9 / 4 ; printf ( "f : %f \n " , f ); return 0 ; } Read more
Comments
Post a Comment