14 Şubat 2016 Pazar

C++ History

Bjarne Stroustrup, a Danish computer scientist, began his work on C++'s predecessor "C with Classes" in 1979.[7] The motivation for creating a new language originated from Stroustrup's experience in programming for his Ph.D. thesis. Stroustrup found that Simula had features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low-level to be suitable for large software development. When Stroustrup started working in AT&T Bell Labs, he had the problem of analyzing the UNIX kernel with respect to distributed computing. Remembering his Ph.D. experience, Stroustrup set out to enhance the Clanguage with Simula-like features.[8] C was chosen because it was general-purpose, fast, portable and widely used. As well as C and Simula's influences, other languages also influenced C++, including ALGOL 68, Ada, CLU and ML.
Initially, the class, derived class, strong typing, inlining and default argument features were added to C via Stroustrup's "C with Classes" to C compiler, Cpre.[9]
In 1983, it was renamed from C with Classes to C++ ("++" being the increment operator in C). New features were added including virtual functions, function name and operator overloading, references, constants, type-safe free-store memory allocation (new/delete), improved type checking, and BCPL style single-line comments with two forward slashes (//), as well as the development of a proper compiler for C++, Cfront.
In 1985, the first edition of The C++ Programming Language was released, which became the definitive reference for the language, as there was not yet an official standard.[10]The first commercial implementation of C++ was released in October of the same year.[7]
In 1989, C++ 2.0 was released, followed by the updated second edition of The C++ Programming Language in 1991.[11] New features in 2.0 included multiple inheritance, abstract classes, static member functions, const member functions, and protected members. In 1990, The Annotated C++ Reference Manual was published. This work became the basis for the future standard. Later feature additions included templates, exceptions, namespaces, new casts, and a boolean type.
After the 2.0 update, C++ evolved relatively slowly until, in 2011, the C++11 standard was released, adding numerous new features, enlarging the standard library further, and providing more facilities to C++ programmers. After a minor C++14 update, released in December 2014, various new additions are planned for 2017.

C++

C++ (pronounced as cee plus plus, /ˈs plʌs plʌs/) is a general-purpose programming language. It has imperative, object-orientedand generic programming features, while also providing facilities for low-level memory manipulation.
It was designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights.[4] C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications,[4] including desktop applications, servers (e.g. e-commerce,web search or SQL servers), and performance-critical applications (e.g. telephone switches or space probes).[5] C++ is a compiledlanguage, with implementations of it available on many platforms and provided by various organizations, including the FSF, LLVM,Microsoft, Intel and IBM.
C++ is standardized by the International Organization for Standardization (ISO), with the latest (and current) standard version ratified and published by ISO in December 2014 as ISO/IEC 14882:2014 (informally known as C++14).[6] The C++ programming language was initially standardized in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, ISO/IEC 14882:2003, standard. The current C++14 standard supersedes these and C++11, with new features and an enlarged standard library. Before the initial standardization in 1998, C++ was developed by Bjarne Stroustrup at Bell Labs since 1979, as an extension of the C language as he wanted an efficient and flexible language similar to C, which also provided high-level features for program organization.
Many other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998).

C++ Bjarne Stroustrup

Bjarne Stroustrup

 
Bjarne Stroustrup
BjarneStroustrup.jpg
Bjarne Stroustrup
BornDecember 30, 1950 (age 65)
Aarhus, Denmark
ResidenceNew York City, New York, U.S.[1]
NationalityDanish
InstitutionsAarhus University
University of Cambridge
Texas A&M University
Bell Labs
Morgan Stanley
Columbia University
Alma materAarhus University (MSc)
Churchill College, Cambridge (PhD)
Doctoral advisorDavid Wheeler
Known forCreating C++
Notable awards
Grace Murray Hopper Award (1993)
IEEE Computer Society Computer Entrepreneur Award (2004)
William Procter Prize for Scientific Achievement (2005)
Dr. Dobb's Excellence in Programming award (2008)
Bjarne Stroustrup (Danish: [ˈbjɑːnə ˈsdʁʌʊ̯ˀsdʁɔb];[2][3] born 30 December 1950) is a Danish computer scientist, most notable for the creation and development of the widely used C++ programming language.[4] He is a Distinguished Research Professor and holds the College of Engineering Chair in Computer Science at Texas A&M University,[5] a visiting professor at Columbia University, and works at Morgan Stanley as a Managing Director in New York.[6][7][8]

Education

Stroustrup has a master's degree in mathematics and computer science (1975) from Aarhus University, Denmark, and a Ph.D. in computer science (1979) from the University of Cambridge, England.[5] His thesis advisor in Cambridge was David Wheeler.[9][10]

Career

Stroustrup began developing C++ in 1978 (then called "C with Classes"), and, in his own words, "invented C++, wrote its early definitions, and produced its first implementation... chose and formulated the design criteria for C++, designed all its major facilities, and was responsible for the processing of extension proposals in the C++ standards committee."[11] Stroustrup also wrote a textbook for the language, The C++ Programming Language.
Stroustrup was the head of AT&T Bell Labs' Large-scale Programming Research department, from its creation until late 2002. Stroustrup was elected member of the National Academy of Engineering in 2004. He is a Fellow of the ACM (1994) and an IEEEFellow. He works at Texas A&M University as a Distinguished Professor where he holds the College of Engineering Endowed Chair in Computer Science.[12][13] He is also a visiting faculty in Computer Science Department at Columbia University.[14] ITMO University noble doctor since 2013[15]

C++ inkişaf etdirən Byörn Straustrup

Bjarne Stroustrup

Byörn Straustrup (30 dekabr 1950-ci ildə dünyaya gəlib) — Danimarkalı kompyuter elmləri üzrə alim, geniş istifadə olunan C++ proqramlaşdırma dilinin yaradıcısı və inkişaf etdiricisi kimi tanınır. O, hal-hazırda Texas A&M universitetində kompüter elmləri üzrə mühəndislik kafedrası kollecinin professoru və sahibidir.
Stourstrup Danimarkanın Aarhus universitetindən riyaziyyat və komputer elmləri üzrə magistr dərəcəsi (1975) və İngiltərənin Kambridge universitetində Çörçill kollecinin tələbəsi kimi doktorluq dərəcəsi almışdır.
BjarneStroustrup.jpg

printf və scanf funksiyasi

Scanf

Scanf funksiyası cin>> funksiyasını əvəz edir.
Lakin scanf funksiyasını yazmaq üçün kitabxana müxtəlifdir.Yəni #include <iostream>
                           #include <stdio.h>
                           using namespace std;
                           int main ()
                           {
                               int a,b;
                             scanf ("%2f.l\n, a,b)
                            }

Printf
Printf funksiyası cout<< funksiyasını əvəz edir.

 int a,b;
                             scanf ("%2f.l\n, a,b)
                             printf (("%2f.l\n, a+b)
                             return 0;
                            }


 

C++




10 Şubat 2016 Çarşamba

Armstronq ədədləri

Armstronq
Armstronq ədədləri o deməkdir ki,əgər ədədin rəqəmlərinin kubunun cəmi həmin ədədə bərabərdirsə onda bu ədəd armstronqdur.
Rəqəmlərinin k-cı qüvvətlərinin cəmi ədədin özünə bərabər olarsa, belə ədədə k-rəqəmli Armstronq ədədi deyilir. Məsələn, k = 3 üçün 153 Armstronq ədədidir, çünki 153 = 13 + 53 + 33.
Verilmiş k üçün bütün k-rəqəmli Armstronq ədədlərini tapın.
Giriş verilənlərinin formatı
Bir sətirdə k (2 < k < 10) ədədi verilir.
Çıxış verilənlərinin formatı
Hər biri ayrıca sətirdə olmaqla k-rəqəmli Armstronq ədədləri artma sırası ilə çıxışa verilir.



#include <iostream>
using namespace std;
int main()
{
long int z=0, S=0,P=0,Q, RQ[10];
int k,i,j;
cin>>k;
for(i=1; i<=9; i++)
RQ[i]=1;
RQ[0]=0;
for(i=2; i<=9; i++)
for(j=0; j<k; j++)
RQ[i]*=i;
for(i=0; i<k; i++)
S=S*10+9;
z=(S+1)/10;
for(i=z; i<=S; i++)
{P=i; Q=0;
while(P>0)
{j=P%10;
Q+=RQ[j];
P/=10;}
if(i==Q)
cout<<Q<<endl;
}
return 0;
}