create a program that asks how old you are.



  • Please tell me where the mistake is.

    #include <stdio.h>
    #include <iostream>
    #include <string.h>
    #include <math.h>
    using namespace std;
    

    int main()
    {

    printf() &lt;&lt; ("How old are you?");
    string myAge;
    scanf &gt;&gt; (myAge);
    printf &lt;&lt; ("you are " &lt;&lt; myAge &lt;&lt; " years old");
    return 0;
    

    }



  • #include <stdio.h>
    
    int main()
    {
        printf("How old are you? ");
        int myAge;
        scanf("%d",&myAge);
        printf("You are %d years old",myAge);
    }
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2