Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ques.1
Conversation opened. 1 unread message. Skip to content Using Gmail with screen readers Search Click here to enable desktop notifications for Gmail. Learn more Hide Gmail COMPOSE Labels Inbox (5,212) Starred Important Sent Mail Drafts (2) Categories Personal Travel More Hangouts More 1 of many Print all In new window Sheep krti haiii---- Baaaaaaaaaa Inbox x Riya Jain Attachments11:43 PM (3 minutes ago) to me Q1 hai ye: Attachments area Click here to Reply or Forward 0.88 GB (5%) of 15 GB used Manage Terms - Privacy Last account activity: 1 minute ago Details #include<stdio.h> void charbinary(char c) { int q,i; for (i = 7; i >= 0; --i) { q=(c & (1 << i))? 1 :0; printf("%d",q); } } void binary(int c,int size) { int q,i; for (i = size; i >= 0; --i) { q=(c & (1 << i))? 1 :0; printf("%d",q); } } typedef union { float f; struct { unsigned int mantissa : 23; unsigned int exponent : 8; unsigned int sign : 1; } field; } myfloat; typedef union { double d; struct { unsigned long long int mantissa : 52; unsigned int exponent : 11; unsigned int sign : 1; } field; }Double; int main(){ char ch; int i; printf("enter a char: "); scanf("%c",&ch); printf("enter an integer:"); scanf("%d",&i); myfloat var; printf("Enter a float : "); scanf("%f",&var.f); Double dou; printf("Enter a double : "); scanf("%lf",&dou.d); printf("\ninternal representation of,\n"); printf("char(%c): ",ch); charbinary(ch); printf("\n"); printf("int(%d): ",i); binary(i,15); printf("\n"); printf("float(%f): ",var.f); printf("%d ",var.field.sign); binary(var.field.exponent, 7); printf(" "); binary(var.field.mantissa, 22); printf("\n"); printf("double(%lf): ",dou.d); printf("%d ",dou.field.sign); binary(dou.field.exponent, 10); printf(" "); binary(dou.field.mantissa, 51); return 0; }
run
|
edit
|
history
|
help
0
Lab 5 HW Spring 2017 v1.1
open(): No such file or directory
ㅇㅇㅇ
Lab 5 HW Spring 2017 v0.5
150114_MatrizSumaPerimetro
Función quicksort decreciente
Undefined argument processing order in C
Rudra
Spring 2017 Lab 5 v1
FloatInt