Microsoft Visual C++ 6
Version of implementation Microsoft Visual C++ of programming language C++Version of Microsoft Visual C++ released in 1998 as a part of Microsoft Visual Studio 6.
Examples:
Fibonacci numbers - C++ (4):
This example uses recursive definition of Fibonacci numbers.
#include <iostream>
int fibonacci(int n)
{
return ( n<=2 ? 1 : fibonacci(n-1) + fibonacci(n-2) );
}
int main(void)
{
for (int n=1; n<=16; n++)
std::cout << fibonacci(n) << ", ";
std::cout << "..." << std::endl;
return 0;
}
Hello, World! - C++ (1):
#include <iostream>
int main(void)
{
std::cout << "Hello, World!" << std::endl;
return 0;
}
Factorial - C++ (2):
This example uses recursive factorial definition.
#include "stdio.h"
__int64 factorial(__int64 n)
{
return ( n==0 ? 1 : n*factorial(n-1) );
}
int main(int argc, char* argv[])
{
for (int n=0; n<=16; n++)
printf( "%d! = %I64d\n", n, factorial(n) );
return 0;
}
Comments
]]>blog comments powered by Disqus
]]>