126k views
0 votes
eclare an integer variable named myNewAge. Declare and initialize an integer variable named myCurrentAge. Initialize this variable with your current age.

User Nana Adjei
by
7.1k points

1 Answer

1 vote

Answer:

The code to this question as follows:

Code:

#include <stdio.h> #defining header file

int main() //defining main method

{

//your code defined here....

int myNewAge; //declaring integer variable myNewAge

int myCurrentAge=21; //declaring integer variable myCurrentAge and initialize a value.

printf("myCurrentAge: %d",myCurrentAge); //print myCurrentAge variable value.

return 0;

}

Output:

myCurrentAge: 21

Explanation:

In the above C language program code, firstly the header file is included, then defining the main method, inside the main method the two integer variable is defined.

  • The "myNewAge" variable doesn't assign any value but in the "myCurrentAge" variable, it assigns an integer value that is "21".
  • In the next line, we print the value of "myCurrentAge" variable.
User Clarissa
by
7.8k points