fork download
  1. #include <stdio.h>
  2.  
  3. #include <stdio.h>
  4.  
  5. int main() {
  6. float a1[30];
  7. printf("Enter number: ");
  8. scanf("%f", &a1[0]); // Use %f for float, and pass the address of the first element
  9. printf("Your number is %.2f\n", a1[0]); // Use %.2f for formatting float output
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Enter number: Your number is 0.00