Posts

Running (pre-loaded)Virtual Machine on VirtualBox

Image
Running Linux systems on Virtual Box is more safer for Beginner.Virtual Box is a free software from oracle which can be downloaded from here The pre installed Linux Image for Machine Learning can be downloaded from from following link
The following steps are to load the virtual machine in Virtual box which is preloaded

step 1  Make a new Virtual machine:       open the virtual box software and click on new
 Name the VM(virtual machine) set the name and type as Linux/windows and choose the distribution you use or set as other as default set the suitable memory size for the vm: its better to keep at least 1 GB if possible for hard disk choose use existing hard disk and use the file button to navigate to the folder where the  vm is downloaded and hit create start the machine there we have 

Don't feel crazy with this 
Just wait a while :)
Hears the vm successfully running :) leave a comment for any further support

Officialy Linux years on Windows

Image
finally we can install linux rigth from our store ....Very happy to see different variations and still adding.

KTU CGPA Calculator

KTU CGPA ca..GPA CALCULATOR Select Semeste

Bubble Sort

Image
Program to sort the list of names in alphabetic order using Bubble sort.

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define max 25
void sort(char *(a)[max],int n)
{
  int i,j;
  char temp[max];
  for(i=0;i<n;i++)
    for(j=n-1;j>=i+1;j--)
    if(strcasecmp(a[j],a[j-1])<0)
    {
      strcpy(temp,a[j-1]);
      strcpy(a[j-1],a[j]);
      strcpy(a[j],temp);
    }
}
void main()
{
  int i,n;
  char *(str)[max];
  printf("Enter no of names to enter:" );
  scanf("%d",&n );
  printf("Enter the names:\n" );
  for(i=0;i<n;i++)
  {
    str[i]=malloc(max);
    scanf("%s",str[i] );
  }
  sort(str,n);
  printf("Names after the sort \n" );
  for(i=0;i<n;i++)
  printf("%s\n",str[i] );
}

OUTPUT

Replace a substring in a string.

Image
Program to replace the given sub string from a string.



#include<stdio.h>
int main()
{
  int ls,i,j,k,flag=0,olt,pos,lt;
  char st[20],sub[20];
  printf("Enter the string:");
  scanf("%[^\n]",st );
  printf("Enter the substring:");
  scanf("%s",sub );
  for(i=0;st[i]!='\0';i++);//to find the length of string
  ls=i;
  for(i=0;sub[i]!='\0';i++);//to find the length of string
  olt=i;
  if(olt<1||olt>ls)
  {
    printf("Not possible to replace\n" );
    return 0;
  }
  for(i=0;i<ls;)
  {
    j=0;
    while(st[i++]==sub[j++])
    {
      if(j==olt)
      {
        flag=1;
        pos=i-olt;
        break;
      }
    }
  }
  if(flag==1)
  {
    printf("Enter new substring:" );
    scanf("%s",sub );
    for(i=0;sub[i]!='\0';i++);
    lt=i;
    for(i=pos,j=0;j<lt;j++,i++)
    {
      if(j<olt)
      st[i]=sub[j];
      else
      {
        for(k=ls+1;k>i;k--)
        st[k]=st[k-1];
        st[ls+2]='\0';
      …

Program which reads a line of characters & store it in a data file in the opposite case.

Image
#include<stdio.h> #include<ctype.h> voidmain() { char a[50];int i; printf("Enter the line of text:"); scanf("%[^\n]",a); printf("%s",a); FILE *fp=fopen("text.dat","w"); for(i=0;a[i]!='\0';i++) { if(islower(a[i])) a[i]=toupper(a[i]); else a[i]=tolower(a[i]); fprintf(fp,"%c",a[i]); } fclose(fp); }

Upgrade your bash on Ubuntu on Windows

Image
With new Creators update,we can upgrade our Bash on Ubuntu on Windows to Ubuntu 16.04 terminal by following the steps (This is most recommended method to upgrade your bash officially form Microsoft).


Step1:open your bash and check its current version        








Step 2:type sudo do-release-upgrade.
           write your password and hit enter.

it will check for any updated releases and download it.

Step 3:it will ask permission for installing it hit y

wait a while,until all the updates are downloaded and installed.

Step 4:
it will ask whether to restart services automatically hit yes.
after all set restart your PC