Skip to main content

Posts

Showing posts from April, 2018

Write a C C++ program to find average of three numbers

Flowchart
Coding in C
#include<stdio.h> int main() {     int n1,n2,n3;     float avg;     printf("Enter number1: ");     scanf("%d",&n1);     printf("Enter number2: ");     scanf("%d",&n2);     printf("Enter number3: ");     scanf("%d",&n3);     avg=(n1+n2+n3)/3.0;     printf("Average of numbers = %f",avg);     return 0; }
Coding in C++
#include<iostream> using namespace std; int main() {     int n1,n2,n3;     float avg;     cout<<"Enter number1: ";     cin>>n1;     cout<<"Enter number2: ";     cin>>n2;     cout<<"Enter number3: ";     cin>>n3;     avg=(n1+n2+n3)/3.0;     cout<<"Average of numbers = "<<avg;     return 0; }
Output

Features and Powers of C

(1). C is a standard programming language. Programming Technique in many famous programming languages of today such as C++, C#, Java, Visual Basic, Java Script, PHP is based on C.
C एक standard प्रोग्रामिंग भाषा है। आज के कई प्रसिद्ध प्रोग्रामिंग भाषाओं जैसे— C++, C#, Java, Visual Basic, Java Script, PHP में प्रोग्रामिंग की तकनीक C पर ही आधारित है।

(2). C is mainly used as a system programming language but it can also be used for developing commercial and scientific applications.
C का प्रयोग मुख्यतः सिस्टम प्रोग्रामिंग भाषा के रूप में किया जाता है किन्तु इसका प्रयोग commercial और scientific एप्लीकेशन को विकसित करने के लिए भी किया जा सकता है।

(3). C has features of both high level language and low level language. That’s why it is also called middle level language.
C में high level language और low level language दोनो की विशेषता होती है। इसीलिए इसे middle level language भी कहा जाता है।

(4). Programs written in C are execute multiple times faster than other high level languages such as BAS…

Write a C C++ program to find sum of two numbers

Flowchart


Coding in C

#include <stdio.h>
int main()
{
    int n1,n2,sum;
    printf("Enter number1: ");
    scanf("%d",&n1);
    printf("Enter number2: ");
    scanf("%d",&n2);
    sum=n1+n2;
    printf("Sum of numbers = %d",sum);
    return 0;
}

Coding in C++
#include<iostream> using namespace std; int main() {     int n1,n2,sum;     cout<<"Enter number1: ";     cin>>n1;     cout<<"Enter number2: ";     cin>>n2;     sum=n1+n2;     cout<<"Sum of numbers = "<<sum;     return 0; }
Output

Brief introduction of C++

What is C++? C++ is a high level programming language. It was developed by Bjarne Stroustrup in 1980. It supports Object Oriented Programming (OOP) in which large programs are divided into smaller parts known as object.   C++ एक High Level प्रोग्रामिंग भाषा है। इसका विकास सन् 1972 में Bjarne Stroustrup ने किया था। यह Object Oriented Programming (OOP) को सपोर्ट करता है जिसमें बड़े प्रोग्राम छोटे-छोटे भागों में विभाजित रहते है जिन्हें objectकहते है।
Why its name is C++? In 1967 Martin Richard developed a programming language BCPL. Later In 1969 Ken Thomson added some new features to BCPL and developed a language called B. Again In 1972 Dennis Ritchie added many new features in B and developed a powerful language which was then called C as it was developed from B. Finally in 1980 Bjarne Stroustrup added object oriented features in C and developed most powerful language what we call C++. सन् 1967 में Martin Richard ने BCPL नामक एक प्रोग्रामिंग भाषा बनाया।बाद में सन् 1969 में Ken Thomson ने BCP…

Brief introduction of C

What is C? C is a high level programming language. It was developed by Dennis Ritchie in 1972. It supports Procedure Oriented Programming (POP) in which large programs are divided into smaller parts known as procedure (function).   C एक High Level प्रोग्रामिंग भाषा है। इसका विकास सन् 1972 में Dennis Ritchie ने किया था। यह Procedure Oriented Programming (POP) को सपोर्ट करता है जिसमें बड़े प्रोग्राम छोटे-छोटे भागों में विभाजित रहते है जिन्हें procedure (function) कहते है।
Why its name is C? In 1967 Martin Richard developed a programming language BCPL. Later In 1969 Ken Thomson added some new features to BCPL and developed a language called B. Again In 1972 Dennis Ritchie added many new features in B and developed a powerful language which was then called C as it was  developed from B. सन् 1967 में Martin Richard ने BCPL नामक एक प्रोग्रामिंग भाषा बनाया।बाद में सन् 1969 में Ken Thomson ने BCPL में कुछ नयी विशेषताएँ जोड़ी और B भाषा का विकास किया।पुनः 1972 में Dennis Ritchie ने B में कई सारे नये…