Posts

Showing posts from March, 2018

How to make a pendrive bootable using CMD || using command prompt (CMD)

search 'cmd' and Run it as 'Run as administrator' And then follow the following steps........ diskpart (press enter key) list disk (press enter key and so on type these words ) select disk 1 clean create partition primary format fs=ntfs quick  (It can take less than 5 minutes so wait for complete 100%   ) active exit and your pan drive is become bootable and ready to use

program for sorting array using selection sort technique || in c programming language

program for sorting array using selection sort technique #include<stdio.h> #include<conio.h> #define size 10    /* you can define the size according to your choice */ void main() {  int arr[size]; int i,j,temp; printf("enter array elements : "); for(i=0;i<size;i++) {            scanf("%d",&arr[i]);  } for(i=0;i<size-1;i++)  {                   for(j=i+1;j<size;j++)                    {                                   if(arr[i]>arr[j])                                  {                                              temp=arr[i];                                              arr[i]=arr[j];                                               arr[j]=temp;                                    }                     }      }  printf("sorted array is: \n"); for(i=0;i<size;i++) {                 printf("%d",arr[i]); } getch(); }

Program to calculate the sum of given number using array

Program to calculate the sum of given number using array  #include<stdio.h> #include<conio.h> void main() {      int arr[100];      int i,n,sum=0;      clrscr();                 /* clrscr() function is work only TURBO C/C++ compiler .      It will not work in CODE BLOCKS compiler.  */      printf("How many number you want to enter?   ");      scanf("%d",&n);      printf("enter the array elements:  ");      for(i=0;i<n;i++)      {            scanf("%d",&arr[i]);       }       printf("your entered array is : ")      for (i=0;i<n;i++)      {                printf("%5d",arr[i]);                sum=sum+arr[i];       }       printf("\nsum of array elements are: %d",sum);       getch(); }

Program for find average of five numbers

Program for find average of  five numbers  #include <stdio. h> #include <conio. h> int main() {  int a, b, c, d, e;  int sum=0;  float avg;   clrscr();  Printf ("enter the five number ");  scanf ("%d%d%d%d%d",&a, &b, &c, &d, &e) ; sum=a+b+c+d+e; avg=sum/5; printf ("sum = %d\n",sum);  printf ("average = %f",avg);   return 0; getch(); }

Program for addition of two number

Program for addition of two number  #include<stdio.h> #include<conio.h> int main() {   int a, b, c;    clrscr();   printf ("enter two number : ");   scanf ("%d%d",&a, &b);     c=a+b;    printf ("addition of two numbers = %d",c);     return 0;   getch(); }

First program in c

First program in c language  #include <stdio. h> #include <condo. h> void main () {  clrscr();  printf ("This is my first program "); getch (); }