Thursday, November 30, 2017

Key Board Shortcuts in Windows with Windows key

Key Board Shortcuts in Windows with Windows key

Windows + D    ----> Desktop
Windows + E     ----> Windows Explorer
Windows + R     ----> Open Run command prompt
Windows + X     -----> Windows Mobility Manager
Windows + M    -----> Minimize all
Windows  + L    -----> Lock system
Windows + F      -----> To find in the system
Windows + P      ------> To get projector options
Windows + number ---> To open that tab in the task bar

Why C language still exists and its importance

What are these computer languages?
Ans: Computer languages are just like languages we(Humans) have to communicate with each other.
But computer language is for communicating with computers.

If I want to speak with American, I need to know English. Similarly to assign work for the computer we need to know computer language.

Machine are there to do our work. But we have to instruct them. We will instruct in their language.

It is 2 types:
1. Low level
2. High level

Low level is like mother tongue, High level is like other than mother tongue.

High level language has to be converted into low level language to be executed bu the computer similarly as we did.

Why we are still using C language?
Even though you are proficient in English, when some one asks a question it will be translated to mother tongue and answer will be framed. Translating it back to English.

How much proficient you are certain things can't be explained in other languages. It can be done only in mother tongue. Even though English is sophisticated we can't leave mother tongue.

I will call C language as very close language to computers mother tongue. Memory access and peripheral device access can be done only with C programming. C language is used to build foundation for all the Electronic systems. On top of that we can do many things with many languages.

You can put foundation only with "C".

So, lets have a look at C, when you have time.

How to print elements of matrix in circular fashion or rounded snake method for both rectangular and square matrix.

How to print elements of matrix in circular fashion or rounded snake method for both rectangular and square matrix.

Did it in static way for easy understanding.

void round_print(int matrix[6][5], int l,int m) {
    int i,j,n;
    if(l>m)
        n=l;
    else
        n=m;                      //to find biggest of column and row

    for (int layer = 0; layer < n / 2; ++layer) {    //For printing in layers
        int first = layer;
        int last_c = m - 1 - layer;           //last column
        int last_r = l - 1 - layer;             //last row
        for(i = first,j=first; j < last_c; ++j) {     //Printing top row
            printf("%d ",matrix[i][j]);
        }
        for(i = first,j=last_c; i < last_r; ++i) {  //right column
            printf("%d ",matrix[i][j]);
        }
        for(i = last_r,j=last_c; j > first; --j) {   //bottom row
            printf("%d ",matrix[i][j]);
        }
        for(i = last_r,j=first; i > first; --i) {    //left column
            printf("%d ",matrix[i][j]);
        }
    }
    if(n%2)                                     // For odd number middle element will be missed
            printf("%d",matrix[n/2][n/2]);
}

int main(){
    int matrix[6][5] = {{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15},{16,17,18,19,20},{21,22,23,24,25},{26,27,18,19,30}};
    for(int i=0;i<6;i++){
        for(int j=0;j<5;j++)
            printf("%3d ",matrix[i][j]);
        printf("\n");
    }
    round_print(matrix,6,5);
    return 0;
}