Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int n = 17;
- float f, f1;
- ///////////////////////////////////////////////
- int main()
- {
- f = (float)n / 2;
- f1 = n % 2;
- printf("f = %.2f\n", f );
- printf("f1 = %.2f\n", f1);
- }
- /*
- #include <stdio.h>
- #include <stdlib.h>
- ///////////////////////////////////////////////
- int main()
- {
- int n = 91;
- int &a = n;
- printf("a = %d\n", a );
- printf("n = %d\n", n );
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- ///////////////////////////////////////////////
- int main()
- {
- int *p = (int*)malloc(4);
- *p = 5;
- int &a = *p;
- printf("p[0] = %d\n", p[0]);
- printf("p[0] = %d\n", *p );
- printf("a = %d\n", a );
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- ///////////////////////////////////////////////
- int main()
- {
- int n = 10;
- int *p = (int*)malloc(4);
- *p = 5;
- printf("%d\n", n);
- printf("%d\n", p[0]);
- }
- */
- /*
- #include <stdio.h>
- int n = 0;
- float f = 3.58;
- ///////////////////////////////////////////////
- int main()
- {
- n = (int)f;
- printf("%d\n", n);
- }
- */
- /*
- #include <stdio.h>
- int n = 17;
- float f = 17;
- ///////////////////////////////////////////////
- int main()
- {
- n /= 2;
- f -= 8.01;
- printf("%d\n", n);
- printf("%.2f\n", f);
- n = f;
- printf("%d\n", n);
- }
- */
- /*
- #include <stdio.h>
- ///////////////////////////////////////////////
- int main()
- {
- int n;
- int *p =&n;
- printf("%d\n", p);
- n = (int)&n;
- printf("&n = %d\n", n);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement