C Language Program To Generate Random Symbols


#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int rnd(void);
void seedrnd();
void ramdom();
int main()
{
  int coun;
  FILE *myfile;
  ramdom();
  myfile = fopen("g:/ds/test/symbols.txt","w");
                if(!myfile)
                {
                                puts("Some kind of file error!");
                                exit(0);
                }
                else
                {
                                   for(coun=0;coun<10000;coun++)
                                  {


                                                fprintf(myfile,"%c            ",rnd());
                                  }
                fclose(myfile);
   }
  //getchar(); /*pause*/
  system("PAUSE");
  return 0;
}
void ramdom(void)
{
    int counter;
    seedrnd();
     for(counter=0;counter<10000;counter++)
     {
                printf("%c           ",rnd());
     }
}
int rnd(void)
{
    int randon;
    randon=rand();
    return(randon);
}
void seedrnd(void)
{
    srand((unsigned)time(NULL));
}

Sample Output:
 create symbols.text
            ô        ß        õ        d        ®              ‑        Π        O       a        “        ú        ø        &       Y                 Ü       Ä       Á       è        É        m       ›        +        ÷        h        ™      ®              Œ                
          ‚        ÿ        —                    0        Ê       
          _               ‑        Ë               œ       Ù       ˆ        ù               ñ        ¨         ù        &       6          >        º        ò        ¼       h        9        ¶        ‹        ì         ”        q        Š               ”        L          ©       Á       {        Ô       N       Ý              y               à        æ       G       ]         ·         ô          ã        /         ß        T        É        ð        À       S        Ä       j         I         à      ®       ¥        Π         ~        i                ‑        8        ‑        ý        è        Š        µ        -        P        =        •        Ý          Í         Ó              à        F        \         c               m       w       ¬        ö        [         ¦         +          À       m       Ø       ~        `        ^        1        g               ¥               G       ±               “          á        I         £        ®       L                  ¬        j         9        ð        '         ¼       g        ˆ        Y          Ö       c        ³         §        ¹         …      é        ·         ü        (        4        Ë        Û       )        æ          Z        ƒ        ¢        y        ð        œ       è        Æ       H                     k        §        ;         ì          v        {        ë        Í         V       5        :         t                c        1        Ø       m              ß          Q       #        c        £        Q       E        l         ¶        h        ¬        R       ü        x        X       ¤         
          5               ú        |         à               Π        r        D      
            š          i           ñ          „           3          B         ¸                    e          ‹           g          …        Р                 Æ            ©                  ®         Ñ         Ž          Ö         E          8          Ê         
            "                   
            *          z          í           T          “           <          é          Q         å                   U                  —        Ô         Z                     Ó         Ì           ø                   ‘           Ç         G         è          ö                   î           ß          ì           t            ä          Р                 j           f           8          †         



Contact:
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

Total Pageviews

CONTACT US

Prof. Roshan P. Helonde
Mobile: +917276355704
WhatsApp: +917276355704
Email: roshanphelonde@rediffmail.com

Enter Project Title

Popular Projects

All Archive

Contact Form

Name

Email *

Message *