149k views
3 votes
Write code that creates a variable called count that has the value of 102. The code then prints the value of count.

User Sccs
by
3.3k points

1 Answer

3 votes

I'm not really sure what language you want this in but since the usual language learnt in HS in C++, I'll do it in C++ and C

In C++ :

#include <iostream>

using namespace std;

int main()

{

int count = 102;

cout << "The value of count is" << count << endl;

return 0;

}

In C:

#include <stdio.h>

int main()

{

int count = 102;

printf("The value of count is %d", count);

return 0;

}

User Chevy Hungerford
by
3.5k points