3. WRITE A C PROGRAM TO DECLARE VARIABLE FOR INTEGER, FLOAT, I.E, OCTAL, DECIMAL, HEXA DECIMAL, FLOATING POINT AND EXPONENTIAL

/*C program to declare variable for integer, float, I.e, octal, decimal, hexa decimal, floating point and exponential*/

#include<stdio.h>
#include<conio.h>
int main()
{
int a;
float b;
clrscr();
printf(“enter a,b values”);
scanf(“%d%f”,&a,&b);
printf(“decimal form of %d=%d\noctal form=%o\n hexa decimal form =%x”,a,a,a);
printf(“floating point of %f=%f\n exponential form = %e”,b,b,b);
getch();
return 0;
}

output

Enter a,b values 88
99.6
Decimal form of 88=88
Octal form = 130
Hexa decimal form = 58
Floating point of 99.600000=99.600000
Exponential form = 9.960000e+1

Comments