C Program to Print one Integers and one float (Entered by the User)
C Program to Print one Integers and one float (Entered by the User)
#include <stdio.h>
int main()
{
int x;
float y;
printf("\n Enter int x value and float y value:");
scanf("%d%f",&x,&y);
printf("\n Display int x values and float y values: %d %f",x,y);
return 0;
}
Output:
Enter int x value and float y value:10 34.875
Display int x values and float y values: 10 34.875000
C Program to Print one Integers and one float (Entered by the User)
#include <stdio.h>
int main()
{
int x;
float y;
printf("\n Enter int x value:");
scanf("%d",&x);
printf("\n Enter float y value:");
scanf("%f",&y);
printf("\n Display int x values: %d ",x);
printf("\n Display float y values: %f ",y);
return 0;
}
Output:
Enter int x value:30
Enter float y value:35.747
Display int x values: 30
Display float y values: 35.747000