Tuesday, 12 April 2022

 1. Python as Shah Rukh Khan

Python is the most popular programming language. Without this programming language, numerous apps and websites could not be developed. This relates to Amitabh Bachchan since he is the oldest in the industry and without him, the charm of the movies and Bollywood industry would be incomplete.

2. JavaScript as Ranveer Kapoor
JavaScript is the programming language, which is considered to be the king of frontend, just like Shah Rukh Khan is considered the king of Bollywood. This programming language is used to make websites work. This programming language has a strong community, and no one can match it, just like no one in the industry can match the outstanding skills of Shah Rukh Khan.

3. Golang/Go as Vicky Kaushal
Golang, also known as Go, is a new programming language that was developed in 2007 by Google. Go programming language is a highly sought-after programming language in terms of skills, just like Vicky Kaushal. Since it is new in the technology world, it hasn’t received a good growth rate, but its great skills and syntax ensure its promising future in the tech world.

4. Java as Salman Khan
Java is a programming language that has been dominating the technology world for the past few years, but currently, it is being seen as a downfall in terms of popularity. This is due to the new programming languages that are emerging in the market. Java is best associated with Salman Khan in the Bollywood industry. At first, he was ruling the Bollywood industry, just like Java, but now, his popularity has been on the decline.

5. C as Amitabh Bachchan
One of the oldest programming languages, other programming languages like JavaScript and C# have emerged from it. C programming language is a popular programming language that is used to build different applications. C programming language is best related to Rishi Kapoor in the Bollywood industry. Just like fans loved Rishi Kapoor for his prominent acting skills and efficiency, developers love the C programming language for its efficiency.

6. Kotlin as Varun Dhawan
Kotlin is a new and emerging programming language that is a great alternative to Java. Kotlin is best related to Varun Dhawan in the Bollywood industry, as he is said to be a replacement for Salman Khan, who we previously related to the Java programming language. Kotlin programming language has an intelligent and safe compiler. This programming language runs on a variety of systems.

7. Ruby as Paresh Rawal
Ruby is a programming language that was developed in the 1990s and is an easy to learn programming language. This programming language is mostly used for scripting, prototyping, and text processing new applications. Although this programming language is widely used, it goes unnoticed, which is the case with Boman Irani. He has marvellous acting skills and has indeed given some fabulous performances, but he mostly goes unnoticed by the industry.

8. Swift as Ranveer Singh
Swift programming language was created by Apple in 2014. This programming language has its separate fanbase, just like Ranveer Singh has. Although this language is mostly used in Apple applications development, Apple developers are true to this programming language. Just like whatever roles and fashion style Ranveer Singh does, his true fans still follow him.

Monday, 12 September 2016

How to do factorials in C

#include<stdio.h>

#include<conio.h>

int main()
{
    int i,fact=1,n;

    clrscr();

    printf("Enter the number: ");

    scanf("%d",&n);  // takes input for calculating the factorial 

    for(i=1;i<=n;i++)
     /* here i=1 and n=5 so 1<=5 its true so the loop is started 
    {

    fact=fact*i;  // fact=1 i=1 so fact*i gives 1 and store this into the fact

    /* after that i is increased by 1 and compute the previous line until i<=n                                                       gives  a false value  */

    printf("%d! = %d\n",i,fact);   
}
    getch();

    return 0;

}

Sunday, 11 September 2016

Top programming Languages


NFA to DFA conversion in C language

/*
        NFA --> DFA conversion program
*/
#include <stdio.h>
#include <string.h>

#define STATES 256
#define SYMBOLS 20

int N_symbols; /* number of input symbols */
int NFA_states; /* number of NFA states */
char *NFAtab[STATES][SYMBOLS];

int DFA_states; /* number of DFA states */
int DFAtab[STATES][SYMBOLS];

/*
        Print state-transition table.
        State names: 'A', 'B', 'C', ...
*/
void put_dfa_table(
        int tab[][SYMBOLS],    /* DFA table */
        int nstates,   /* number of states */
        int nsymbols)  /* number of input symbols */
{
        int i, j;

        puts("STATE TRANSITION TABLE");

        /* input symbols: '0', '1', ... */
        printf("     | ");
        for (i = 0; i < nsymbols; i++) printf("  %c  ", '0'+i);

        printf("\n-----+--");
        for (i = 0; i < nsymbols; i++) printf("-----");
        printf("\n");

        for (i = 0; i < nstates; i++) {
               printf("  %c  | ", 'A'+i);     /* state */
               for (j = 0; j < nsymbols; j++)
                       printf("  %c  ", 'A'+tab[i][j]);
               printf("\n");
        }
}

/*
        Initialize NFA table.
*/
void init_NFA_table()
{
/*
        NFA table for ex.21 at p.76

        NFAtab[0][0] = "01";
        NFAtab[0][1] = "0";
        NFAtab[1][0] = "";
        NFAtab[1][1] = "01";

        NFA_states = 2;
        DFA_states = 0;
        N_symbols = 2;
*/
/*
        NFA table for ex.17 at p.72
*/
        NFAtab[0][0] = "12";
        NFAtab[0][1] = "13";
        NFAtab[1][0] = "12";
        NFAtab[1][1] = "13";
        NFAtab[2][0] = "4";
        NFAtab[2][1] = "";
        NFAtab[3][0] = "";
        NFAtab[3][1] = "4";
        NFAtab[4][0] = "4";
        NFAtab[4][1] = "4";

        NFA_states = 5;
        DFA_states = 0;
        N_symbols = 2;
}

/*
        String 't' is merged into 's' in an alphabetical order.
*/
void string_merge(char *s, char *t)
{
        char temp[STATES], *r=temp, *p=s;

        while (*p && *t) {
               if (*p == *t) {
                       *r++ = *p++; t++;
               } else if (*p < *t) {
                       *r++ = *p++;
               } else
                       *r++ = *t++;
        }
        *r = '\0';

        if (*p) strcat(r, p);
        else if (*t) strcat(r, t);

        strcpy(s, temp);
}

/*
        Get next-state string for current-state string.
        (state ½ºÆ®¸µÀ̹ǷΠ°¢ state¿¡ ´ëÇØ nextstate¸¦ merge)
*/
void get_next_state(char *nextstates, char *cur_states,
        char *nfa[STATES][SYMBOLS], int n_nfa, int symbol)
{
        int i;
        char temp[STATES];

        temp[0] = '\0';
        for (i = 0; i < strlen(cur_states); i++)
               string_merge(temp, nfa[cur_states[i]-'0'][symbol]);
        strcpy(nextstates, temp);
}

/*
        statename Å×ÀÌºí¿¡¼­ 'state'¸¦ ã¾Æ index¸¦ return.
        'state'°¡ Å×ÀÌºí¿¡ ¾øÀ¸¸é ³¡¿¡ Ãß°¡Çϰí index¸¦ return.
*/
int state_index(char *state, char statename[][STATES], int *pn)
{
        int i;

        if (!*state) return -1;        /* no next state */

        for (i = 0; i < *pn; i++)
               if (!strcmp(state, statename[i])) return i;

        strcpy(statename[i], state);   /* new state-name */
        return (*pn)++;
}

/*
        Convert NFA table to DFA table.
        Method:
               0. state-nameÀÌ ½ºÆ®¸µÀ̹ǷΠstatename Å×À̺í ÀÌ¿ë
                  'n' -- statename[]¿¡ µî·ÏµÈ state °³¼ö
               1. DFA tableÀÇ entry °³¼ö¸¦ 1·Î ÃʱâÈ­ ¹× statename¿¡ Ãß°¡
               2. statename[i]ÀÇ °¢ symbolµé¿¡ ´ëÇØ nextstate °è»ê
               3. nextstate°¡ ½ºÆ®¸µÀ̹ǷΠstatenameÀÇ index¸¦ DFA¿¡ ³ÖÀ½
        Return value: number of DFA states.
*/
int nfa_to_dfa(char *nfa[STATES][SYMBOLS], int n_nfa,
        int n_sym, int dfa[][SYMBOLS])
{
        char statename[STATES][STATES];
        int i = 0;     /* current index of DFA */
        int n = 1;     /* number of DFA states */

        char nextstate[STATES];
        int j;

        strcpy(statename[0], "0");     /* start state */

        for (i = 0; i < n; i++) {      /* for each DFA state */
               for (j = 0; j < n_sym; j++) {  /* for each input symbol */
                       get_next_state(nextstate, statename[i], nfa, n_nfa, j);
                       dfa[i][j] = state_index(nextstate, statename, &n);
               }
        }

        return n;      /* number of DFA states */
}

void main()
{
        init_NFA_table();
        DFA_states = nfa_to_dfa(NFAtab, NFA_states, N_symbols, DFAtab);
        put_dfa_table(DFAtab, DFA_states, N_symbols);
}


Difference between all formats

Criteria
NTFS5
NTFS
exFAT
FAT32
FAT16
FAT12
Operating System
Windows 2000
Windows XP
Windows 2003 Server
Windows 2008
Windows Vista
Windows 7
Windows NT
Windows 2000
Windows XP
Windows 2003 Server
Windows 2008Windows Vista
Windows 7
Windows CE 6.0
Windows Vista SP1
Windows 7
WinXP+KB955704
DOS v7 and higher
Windows 98
Windows ME
Windows 2000
Windows XP
Windows 2003 Server
Windows Vista
Windows 7
DOS All versions of Microsoft Windows
DOS All versions of Microsoft Windows
Limitations
Max Volume Size
264 clusters minus 1 cluster
232 clusters minus 1 cluster
128PB
32GB for all OS. 2TB for some OS
2GB for all OS. 4GB for some OS
16MB
Max Files on Volume
4,294,967,295
(232-1)
4,294,967,295
(232-1)
Nearly Unlimited
4194304
65536

Max File Size
264 bytes
(16 ExaBytes) minus 1KB
244 bytes
(16 TeraBytes) minus 64KB
16EB
4GB minus 2 Bytes
2GB (Limit Only by Volume Size)
16MB (Limit Only by Volume Size)
Max Clusters Number
264 clusters minus 1 cluster
232 clusters minus 1 cluster
4294967295
4177918
65520
4080
Max File Name Length
Up to 255
Up to 255
Up to 255
Up to 255
Standard - 8.3
Extended - up to 255
Up to 254
File System Features
Unicode File Names
Unicode Character Set
Unicode Character Set
Unicode Character Set
System Character Set
System Character Set
System Character Set
System Records Mirror
MFT Mirror File
MFT Mirror File
No
Second Copy of FAT
Second Copy of FAT
Second Copy of FAT
Boot Sector Location
First and Last Sectors
First and Last Sectors
Sectors 0 to 11 Copy in 12 to 23
First Sector and Copy in Sector #6
First Sector
First Sector
File Attributes
Standard and Custom
Standard and Custom
Standard Set
Standard Set
Standard Set
Standard Set
Alternate Streams
Yes
Yes
No
No
No
No
Compression
Yes
Yes
No
No
No
No
Encryption
Yes
No
No
No
No
No
Object Permissions
Yes
Yes
Yes
No
No
No
Disk Quotas
Yes
No
No
No
No
No
Sparse Files
Yes
No
No
No
No
No
Reparse Points
Yes
No
No
No
No
No
Volume Mount Points
Yes
No
No
No
No
No
Overall Performance
Built-In Security
Yes
Yes
Yes minimal ACL only
No
No
No
Recoverability
Yes
Yes
Yes if TFAT activated
No
No
No
Performance
Low on small volumes High on Large
Low on small volumes High on Large
High
High on small volumes Low on large
Highest on small volumes Low on large
High
Disk Space Economy
Max
Max
Max
Average
Minimal on large volumes
Max
Fault Tolerance
Max
Max
Yes if TFAT activated
Minimal
Average
Average