Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

JCT Students (First Batch(2069-2070))

Bhim Higher Secondary School Suntopar, Dolakha

Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

Showing posts with label C programming. Show all posts
Showing posts with label C programming. Show all posts

Wednesday, August 3, 2016

Program in C for 2 12 22 32 series upto 10th term

/* Program for 2 12 22 32 series upto 10th term */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a=2,i;
    i=1;
    do
    {
        printf(" %d ",a);
        a=a+10;
        i++;
    }
    while(i<=10);
    getch();
}

Monday, August 1, 2016

Fibonacci Series in C Programming using Do While Loop

/* 3 3 6 9 15 fibonacci series upto 10th term */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a=3,b=3,c,i;
    printf("\n %d",a);
    printf(" %d ",b);
    i=1;
    do
    {
        c=a+b;
        printf("%d ",c);
        a=b;
        b=c;
        i++;
    }
    while (i<=10);
    getch();
}

Program in C for 1 4 9 16 series upto 20th term using Do- While Loop

/* 1 4 9 16 series upto 20th term */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a,i;
    i=1;
    do
    {
        a=i*i;
        printf("%d ",a);
        i++;
    }
    while (i<=20);
    getch();
}

Program in C for 1 5 9 series upto 10th term

/* 1 5 9 series upto 10th term */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a=1,i;
    i=1;
    do
    {
        printf("%d ",a);
        a+=3;
        i++;
    }
    while (i<=10);
    getch();
}

Sunday, July 31, 2016

Program in C for Traingle : Nested Loop


#include<stdio.h>
#include<conio.h>
void main()
{
    int i,j;
    for(i=1;i<=5;i++)
    {
        for(j=1;j<=i;j++)
        {
            printf("%d",j);
        }
        printf("\n");
    }
    getch();
}

Program in C to find the factorial of a given number


/* Program to find the factorial of a given number */
#include<stdio.h>
#include<conio.h>
void main()
{
    int i, num, fact = 1;

  printf("\n Enter a number to calculate it's factorial : ");
  scanf("%d", &num);

  for (i = 1; i <= num; i++)
    fact = fact * i;

  printf(" Factorial of %d = %d\n", num, fact);
  getch();
}

Program in C to find sum, difference and product of 2 numbers using switch case statement

/* Program in C to find sum, difference and product of 2 numbers using switch case statement */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a,b,ch;
    printf("\n Enter First Number :");
    scanf("%d",&a);
    printf("\n Enter Second Number :");
    scanf("%d",&b);
    printf("\n Enter Your Choice: ( 1. Sum:  2. Difference :  3. Product: ) ");
    scanf("%d",&ch);
    switch (ch)
    {
        case 1:
            {
                printf("\n The sum = %d",a+b);
                break;
            }
            case 2:
            {
                printf("\n The difference = %d",a-b);
                break;
            }
            case 3:
            {
                printf("\n The Product = %d",a*b);
                break;
            }
            default:
            {
                printf("\n out of range");
            }
    }
    getch();
}

Program in C to display first 10 even numbers using while loop

/* Program in C to display first 10 even numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a=2,i=1;
    while(i<=10)
    {
        printf(" %d ",a);
        a=a+2;
        i++;
    }
    getch();
}

Tuesday, July 26, 2016

Program in C For Series 2 4 8 16...... upto nth term

/* Program in C For Series 2 4 8 16...... upto nth term */
#include<stdio.h>
#include<conio.h>
void main()
{
    int a=2,i,num;
    printf("\n Enter any number :");
    scanf("%d",&num);
    for(i=1;i<=num;i++)
    {
    printf(" %d ",a);
    a=a*2;
    }
    getch();
}

Wednesday, December 18, 2013

What is C, What is C++, and What is the Difference?




C is a programming language originally developed for developing the Unix operating system. It is a High-level (also called Middle-level) and powerful language, but it lacks many modern and useful constructs. C++ is a newer language, based on C, that adds many more modern programming language features that make it easier to program than C.

Basically, C++ maintains all aspects of the C language, while providing new features to programmers that make it easier to write useful and sophisticated programs. 

For example, C++ makes it easier to manage memory and adds several features to allow "object-oriented" programming and "generic" programming. Basically, it makes it easier for programmers to stop thinking about the nitty-gritty details of how the machine works and think about the problems they are trying to solve.


So, what is C++ used for?

C++ is a powerful general-purpose programming language. It can be used to create small programs or large applications. It can be used to make CGI scripts or console-only DOS programs. C++ allows you to create programs to do almost anything you need to do. The creator of C++, Bjarne Stroustrup, has put together a partial list of applications written in C++.