-->

program to understand fclose() with stdout

using codeblocks
---------------------------------------------------------------------------------------------------------
//understanding fclose() in the sense of stdout.
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");       //prints hello world
    fclose(stdout);                 // closes the data to be written to device
    printf("goodbye");               //does not print good bye.
    return 0;
}

------------------------------------------------------------------------------------
using turboc++
--------------------------------------------------------------------------------
//understanding fclose() in the sense of stdout.
#include <stdio.h>
#include <conio.h>

int main()
{
    printf("Hello world!\n");       //prints hello world
    fclose(stdout);                 // closes the data to be written to device
    printf("goodbye");               //does not print good bye.
    getch();
    return 0;
}

other programs

program to generate random numbers

using codeblocks
---------------------------------------------------------------------------------------------
//progrm to generate random numbers
#include <stdio.h>
#include <stdlib.h>  //contains rand() function
int main()
{
    int k,number;
    printf("how many u want=\n");
    scanf("%d",&number);
    printf("some randomly generated numbers are given below.\n");
    for(k=0;k<=number;k++)
    {
        printf("%7d\t",rand());//prints randomly generated numbers
    }
    return 0;
}
----------------------------------------------------------------------------------------------
using turboc++
--------------------------------------------------------------------------------------------------------
//progrm to generate random numbers
#include <stdio.h>
#include <stdlib.h>  //contains rand() function
#include<conio.h>
int main()
{
    int k,number;
    printf("how many u want=\n");
    scanf("%d",&number);
    printf("some randomly generated numbers are given below.\n");
    for(k=0;k<=number;k++)
    {
        printf("%7d\t",rand());//prints randomly generated numbers
    }
    getch();
    return 0;
}

enum data type with value

using codeblocks
-------------------------------------------------------------------------------------------------------
//enum simple program
#include <stdio.h>
#include <stdlib.h>
enum computer{samsung=1,LG,apple,hp,acer=5}; // list of values of enum. value location starts from 1.
enum computer find;                         //variable for object "computer"

int main()
{

   for(find=samsung;find<=acer;find++)// find variable runs from samsung to acer. The value runs from 1 to 5.

   {
       printf("location of =%d\n",find);// display that. the value increases itself.
   }
    return 0;
}

//or
/*
//enum simple program
#include <stdio.h>
#include <stdlib.h>

int main()
{
enum computer{samsung=1,LG,apple,hp,acer=5}; // list of values of enum. value location starts from 1.
enum computer find;                         //variable for object "computer"

    for(find=samsung;find<=acer;find++)// find variable runs from samsung to acer. The value runs from 1 to 5.

   {
       printf("location =%d\n",find);// display that. the value increases itself.
   }
    return 0;
}
*/
----------------------------------------------------------------------------------------------------
using turboc++
------------------------------------------------------------------------------------------------------------

//enum simple program
#include <stdio.h>
#include <stdlib.h>
enum computer{samsung=1,LG,apple,hp,acer=5}; // list of values of enum. value location starts from 1.
enum computer find;                         //variable for object "computer"

int main()
{

   for(find=samsung;find<=acer;find++)// find variable runs from samsung to acer. The value runs from 1 to 5.

   {
       printf("location of =%d\n",find);// display that. the value increases itself.
   }
    return 0;
}

//or
/*
//enum simple program
#include <stdio.h>
#include <stdlib.h>

int main()
{
enum computer{samsung=1,LG,apple,hp,acer=5}; // list of values of enum. value location starts from 1.
enum computer find;                         //variable for object "computer"

    for(find=samsung;find<=acer;find++)// find variable runs from samsung to acer. The value runs from 1 to 5.

   {
       printf("location =%d\n",find);// display that. the value increases itself.
   }
    return 0;
}
*/