world-of-c-programming.blogspot.in - C basic lab









Search Preview

World of C Programming: C basic lab

world-of-c-programming.blogspot.in
This is an try to put the solutions of all problems related to C and C++. Labs: DSA, DAA, OS, Graphics, Compiler, Network. Extra: PROBLEMS, FORUM.
.in > world-of-c-programming.blogspot.in

SEO audit: Content analysis

Language Error! No language localisation is found.
Title World of C Programming: C basic lab
Text / HTML ratio 21 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud int string = number basic program Lab Sharma lab strcatstringc main Mangi Lal Labels Pinterest converts Posted Email ThisBlogThisShare FacebookShare
Keywords consistency
Keyword Content Title Description Headings
int 41
string 31
= 28
number 28
basic 24
program 23
Headings
H1 H2 H3 H4 H5 H6
1 18 16 0 0 0
Images We found 38 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
int 41 2.05 %
string 31 1.55 %
= 28 1.40 %
number 28 1.40 %
basic 24 1.20 %
program 23 1.15 %
Lab 22 1.10 %
Sharma 22 1.10 %
lab 22 1.10 %
strcatstringc 18 0.90 %
main 18 0.90 %
Mangi 17 0.85 %
Lal 17 0.85 %
Labels 17 0.85 %
Pinterest 16 0.80 %
converts 16 0.80 %
Posted 16 0.80 %
Email 16 0.80 %
ThisBlogThisShare 16 0.80 %
FacebookShare 16 0.80 %

SEO Keywords (Two Word)

Keyword Occurrence Density
C basic 24 1.20 %
basic lab 22 1.10 %
Mangi Lal 17 0.85 %
Lal Sharma 17 0.85 %
ThisBlogThisShare to 16 0.80 %
to TwitterShare 16 0.80 %
by Mangi 16 0.80 %
Sharma at 16 0.80 %
Labels C 16 0.80 %
Posted by 16 0.80 %
Email ThisBlogThisShare 16 0.80 %
TwitterShare to 16 0.80 %
to FacebookShare 16 0.80 %
FacebookShare to 16 0.80 %
to Pinterest 16 0.80 %
to number 16 0.80 %
Pinterest Labels 16 0.80 %
converts to 16 0.80 %
void main 13 0.65 %
value = 12 0.60 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
C basic lab 22 1.10 % No
Mangi Lal Sharma 17 0.85 % No
Posted by Mangi 16 0.80 % No
Pinterest Labels C 16 0.80 % No
to Pinterest Labels 16 0.80 % No
FacebookShare to Pinterest 16 0.80 % No
to FacebookShare to 16 0.80 % No
converts to number 16 0.80 % No
TwitterShare to FacebookShare 16 0.80 % No
to TwitterShare to 16 0.80 % No
ThisBlogThisShare to TwitterShare 16 0.80 % No
Labels C basic 16 0.80 % No
Email ThisBlogThisShare to 16 0.80 % No
Lal Sharma at 16 0.80 % No
by Mangi Lal 16 0.80 % No
this post Email 11 0.55 % No
to this post 11 0.55 % No
Links to this 11 0.55 % No
pm No comments 11 0.55 % No
post Email ThisBlogThisShare 11 0.55 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
Mangi Lal Sharma at 16 0.80 % No
to Pinterest Labels C 16 0.80 % No
Labels C basic lab 16 0.80 % No
FacebookShare to Pinterest Labels 16 0.80 % No
Posted by Mangi Lal 16 0.80 % No
to FacebookShare to Pinterest 16 0.80 % No
TwitterShare to FacebookShare to 16 0.80 % No
by Mangi Lal Sharma 16 0.80 % No
to TwitterShare to FacebookShare 16 0.80 % No
ThisBlogThisShare to TwitterShare to 16 0.80 % No
Pinterest Labels C basic 16 0.80 % No
Email ThisBlogThisShare to TwitterShare 16 0.80 % No
post Email ThisBlogThisShare to 11 0.55 % No
Links to this post 11 0.55 % No
this post Email ThisBlogThisShare 11 0.55 % No
to this post Email 11 0.55 % No
comments Links to this 9 0.45 % No
pm No comments Links 8 0.40 % No
No comments Links to 8 0.40 % No
converts to number 12 6 0.30 % No

Internal links in - world-of-c-programming.blogspot.in

Welcome
World of C Programming: Welcome
C basic lab
World of C Programming: C basic lab
C++ basic Lab
World of C Programming: C++ basic lab
DSA Lab
World of C Programming: DSA Lab
DAA Lab
World of C Programming: DAA Lab
OS Lab
World of C Programming: OS Lab
Graphics Lab
World of C Programming: Graphics Lab
Compiler Lab
World of C Programming: Compiler Lab
Network Lab
World of C Programming: Network Lab
PROBLEMS
World of C Programming: PROBLEMS
FORUM
World of C Programming: FORUM

World-of-c-programming.blogspot.in Spined HTML


World of C Programming: C vital lab World of C Programming This is a try to put the solutions of each possible problem related to C and C++. You can find here C vital lab, C++ vital Lab, Data Structure Lab, DAA Lab, Operating System Lab, Graphics Lab, Compiler Lab, Network Lab, and other problems. Pages Home Welcome C vital lab C++ vital Lab DSA Lab DAA Lab OS Lab Graphics Lab Compiler Lab Network Lab PROBLEMS FORUM Showing posts with label C vital lab. Show all posts Showing posts with label C vital lab. Show all posts Saturday, 12 September 2015 C program for User specified Custom atoi FunctionLawmaking/* C program: atoi function custom Description: atoi function convert string to integer representation of integral numbers. Example 1: string "02302"    converts to number 2302 Example 2: string "abcd"     returns 0 Example 3: string "-0234"    converts to number -234 Example 4: string "0023ABCD" converts to number 23 Example 5: string "12abc45g" converts to number 12 Example 6: string "--0123"   returns 0 Example 7: string "" (NULL)  returns 0 Example 8: string "   234a"  converts to number 234 Example 9: string "+  239b"  returns 0 Example10: string "+239"     converts to number 239 Example11: string "   +12"   converts to number 12 Example12: string "   -12"   converts to number -12 Compiler: Turbo C++ 3.0 Author: Mangilal Sharma Date: September 12, 2015 Program for: world-of-c-programming.blogpost.com Program number: 102 */ #include<stdio.h> //for printf and gets #include<conio.h> //for clrscr and getch #include<string.h> //for strcpy typedef enum {false, true} bool; //To use bool data type bool isNotNumericChar(char x) //to trammels the weft {  return(x >= '0' && x<= '9')? false:true; } int myAtoi(char *str) //Cutom atoi function lawmaking {  int result = 0; //Initialize result variable  int sign = 1; //Initialize sign as positive  int i = 0; //index of first digit in string  if(str == NULL) return 0;  //If number is negative, then update sign  while(str[i] == ' ') i++;  if(str[i] == '-')  {   sign = -1;   i++;  }  else if(str[i] == '+')  {   i++;  }  //Iterate through all digits of input string and update result value  for(;str[i]!= '\0';i++)  {   if(isNotNumericChar(str[i])) break; //Break when non numeric char occurs   //We can moreover use isdigit function from ctype.h instead of our custom function   result = result*10 + str[i] - '0';   //subtracted ASCII value of zero from ASCII value of current digit weft  }  return sign*result; } int main() {  char string[] = "02302";  int val = myAtoi(string);  clrscr();  printf("String value = %s, Int value = %d\n",string,val);  strcpy(string,"C Program");  val = myAtoi(string);  printf("String value = %s, Int value = %d\n",string,val);  printf("Press y for try your strings to atoi function.\n");  printf("Press any other key to exit.\n");  while(getch() == 'y')  {   printf("Enter String and printing enter:");   gets(string);   printf("String value = %s, Int value = %d\n",string,myAtoi(string));  }  return 1; } Posted by Mangi Lal Sharma at 9/12/2015 07:56:00 pm 2 comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab C Program to Demonstrate use of atoi Function /* C program: atoi function use Description: atoi function convert string to integer representation of integral numbers. Example 1: string "02302"    converts to number 2302 Example 2: string "abcd"     returns 0 Example 3: string "-0234"    converts to number -234 Example 4: string "0023ABCD" converts to number 23 Example 5: string "12abc45g" converts to number 12 Example 6: string "--0123"   returns 0 Example 7: string "" (NULL)  returns 0 Example 8: string "   234a"  converts to number 234 Example 9: string "+  239b"  returns 0 Example10: string "+239"     converts to number 239 Example11: string "   +12"   converts to number 12 Example12: string "   -12"   converts to number -12 Compiler: Turbo C++ 3.0 Author: Mangilal Sharma Date: September 12, 2015 Program for: world-of-c-programming.blogpost.com Program number: 101 */ #include<stdio.h> //for printf and gets #include<conio.h> //for clrscr and getch #include<stdlib.h> //for atoi #include<string.h> //for strcpy void main() {  char string[] = "02302";  clrscr();  printf("String value = %s, Int value = %d\n",string,atoi(string));  strcpy(string,"C Program");  printf("String value = %s, Int value = %d\n",string,atoi(string));  printf("Press y for try your strings to atoi function.\n");  printf("Press any other key to exit.\n");  while(getch() == 'y')  {   printf("Enter String and printing enter:");   gets(string);   printf("String value = %s, Int value = %d\n",string,atoi(string));  } } Posted by Mangi Lal Sharma at 9/12/2015 07:48:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Saturday, 8 November 2014 Determine size of a file reading byte by byte /*Program to determine size of a file.This program works for any type of file format. Read byte by byte.Author: Mangilal SaraswatCompiler: Dev-C++ 4.9.9.2Date: 4 Nov, 2014 Program Number: 62*/#include<stdio.h>#include<conio.h>#include<stdlib.h>int main(){   FILE *fp;   char filename[30];   int ch;   printf("Please input a file name:");   gets(filename);   fp = fopen(filename, "rb"); //read file in binary mode; rb mandetary to read any type of files       if(fp == NULL)    {     perror("Error while opening the file");     getch();     exit(EXIT_FAILURE);    }   fseek(fp, SEEK_SET, 0); //Seek to the whence of the file   /* Read and exhibit data as well summate file size */   int count=0; //variable to make counting of bytes that we going to read.   while((ch=int(fgetc(fp)))+1) //means loop will run till we not get -1 (EOF character)   {    //printf("%d ",ch); //we can print well-constructed file in ascii format of characters.    count++;   }       /*Instead of using whilom whilom transmission method we can use pursuit library functions too.    fseek(fp,0L,SEEK_END); //go to last position in file    count = ftell(fp); //Tell cursor current position byte number*/      printf("File size is: %d Byte", count);   fclose(fp);   getch();   return(0);} For download .exe file click here. Posted by Mangi Lal Sharma at 11/08/2014 01:50:00 pm 1 comment: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Wednesday, 5 November 2014 ASCII to weft Conversion /*A C program to implement ASCII lawmaking to weft Conversion.Author: Mangilal SaraswatDate: 5 November, 2014*/#include<stdio.h>#include<conio.h>void main(){ int ascii; clrscr(); printf("ASCII toWeftconverter\n"); printf(">Give ASCII (range 0 to 255) as input and get character.\n"); printf(">Give input 256 to exit from here.\n"); while(1)      //loop execute untill exit by inward 256 {  printf("ASCII value: ");  scanf("%d",&ascii);  if(ascii==256) break;  else printf("Character: %c\n",ascii); }} Posted by Mangi Lal Sharma at 11/05/2014 05:32:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital labWeftto ASCIILawmakingConversion /*A C program to implement weft to ASCII lawmaking Conversion.Author: Mangilal SaraswatDate: 5 November, 2014*/#include<stdio.h>#include<conio.h>void main(){ char character; clrscr(); printf("Character to ASCII converter\n"); printf(">Give input weft and get ASCII code.\n"); printf(">Give input e to exit from here.\n"); while(1)      //loop execute untill exit by inward e {  printf("Character: ");  //use gets instead of scanf considering scanf moreover capture pressing enter.  gets(&character);  if(character=='e') break;  else printf("ASCII code: %d\n",character); }} Posted by Mangi Lal Sharma at 11/05/2014 05:13:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Friday, 26 July 2013 C program to convert numbers into billion, million, thousand (words) /* Name: C program to convert numbers into words  (Short scale Arabic numbering system i.e. ten, hundred, thousand, million, billion) Author: Prashant Jain (Google plus: https://plus.google.com/110117450187891236113) Date: 26-07-13 14:09 Description: This program is written to demonstrate the English Translation of numbers up to 4 billion.  Compiler: Turbo C++ 3.0 */ #include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> int main() {  int skip1=0,skip2=0,skip3=0;  int choice; unsigned long n; int p1,p2,p3,p4,p5,p6,q2,r2,s2,q3,r3,s3; char c[20][10]={"Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen" }; char c2[11][10]={"Zero","Ten","Twenty","Thirty","Fourty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"}; char string[100]=""; while(1) {  p1=p2=p3=p4=p5=p6=q2=r2=s2=q3=r3=s3=0;  printf("Enter any number upto 4 billion: "); scanf("%d",&n); if(n==0) printf("zero"); p1=n/1000000000; n=n%1000000000; p2=n/1000000; q2=p2/100; p2=p2%100; r2=p2/10; p2=p2%10; s2=p2; n=n%1000000; p3=n/1000;  q3=p3/100; p3=p3%100; r3=p3/10; p3=p3%10; s3=p3; n=n%1000; p4=n/100; n=n%100; p5=n/10; n=n%10; p6=n; if(p1!=0) {  strcat(string,c[p1]);  strcat(string," Billion "); } if(p2!=0){ if(q2!=0){ strcat(string,c[q2]); strcat(string," hundred "); if(r2!=0){ if(r2==1){ strcat(string,c[10+s2]); skip1=1; } if(skip1!=1){ strcat(string,c2[r2]); } strcat(string," "); if(skip1!=1){ if(s2!=0){ strcat(string,c[s2]); } } } else{ strcat(string," "); if(skip1!=1){ if(s2!=0){ strcat(string,c[s2]); } } } } else{ if(r2!=0){ if(r2==1){ strcat(string,c[10+s2]); skip1=1; } if(skip1!=1){ strcat(string,c2[r2]); } strcat(string," "); if(skip1!=1){ if(s2!=0){ strcat(string,c[s2]); } } } else{ strcat(string," "); if(s2!=0){ strcat(string,c[s2]); } } } strcat(string," million "); } if(p3!=0){ if(q3!=0){ strcat(string,c[q3]); strcat(string," hundred "); if(r3!=0){ if(r3==1){ strcat(string,c[10+s3]); skip2=1; } if(skip2!=1){ strcat(string,c2[r3]); } strcat(string," "); if(skip2!=1){ if(s3!=0){ strcat(string,c[s3]); } } } else{ if(s3!=0){ strcat(string,c[s3]); } } } else{ if(r3!=0){ if(r3==1){ strcat(string,c[10+p6]); skip2=1; } if(skip2!=1){ strcat(string,c2[r3]); } strcat(string," "); if(skip2!=1){ if(s3!=0){ strcat(string,c[s3]); } } } else{ if(s3!=0){ strcat(string,c[s3]); } } } strcat(string," thousand "); } if(p4!=0){ strcat(string,c[p4]); strcat(string," hundred "); } if(p5!=0){ if(p5==1){ strcat(string,c[10+p6]); skip3=1; } if(skip3!=1){ strcat(string,c2[p5]); } strcat(string," "); } if(skip3!=1){ if(p6!=0) { strcat(string,c[p6]); } } printf("%s",string); choice=getch(); if(choice==27) exit(1); printf("\n\n"); strcpy(string,""); fflush(stdin); } } Posted by Mangi Lal Sharma at 7/26/2013 02:39:00 pm 1 comment: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Friday, 21 June 2013 Armstrong number (Entered no. is armstrong or not) /* compiler- Turbo c++ author- Mangilal Sharma =================================*/  #include<stdio.h> #include<conio.h> #include<math.h> void main() {  int n,a,b,arm=0;  clrscr();  printf("Enter a number: ");  scanf("%d",&n);  b=n;  while(n>0)  {   a=n%10;   n=n/10;   arm=arm+pow(a,3);  }  printf("Entered digit's sum of the cubes is: %d\n",arm);  if(arm==b)  printf("Entered no. is armstrong");  else  printf("Entered no. is not armstrong");  getch(); } /*=============================19Nov.,2010=============================*/ Posted by Mangi Lal Sharma at 6/21/2013 02:06:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab C program to print reverse of a entered number /* compiler- Turbo c++ author- Mangilal Sharma =================================*/  #include <conio.h> #include <stdio.h> void main() {  clrscr();  int sum=0,num,a,n;  printf("Enter No. in range of int (less than 32768): ");  scanf("%d",&num);  printf("Reverse of '%d' is: ",num);  while(num>0)  {   a=num%10;   sum=sum+a;   printf("%d",a);   num=num/10;  }  getch(); } /*=============================19Nov.,2010=============================*/ Posted by Mangi Lal Sharma at 6/21/2013 12:53:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Saturday, 6 April 2013 Sum of n prime numbers /* compiler- Turbo c++ author- Mangilal Sarswat --------------------------------------------------------*/ /* A program to find out sum of prime numbers. Suppose that user enter n=5 then output must be 28 that is sum of 5 prime values 2+3+5+7+11. You can modify this program for limited range as sum of prime numbers that come between 100 to 1000 etc.*/ #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<math.h> long sum(int n) { long count=1, sum=2; for(long i=3; ;i++) { int pass=0; for(long j=2; j<=ceil(sqrt(i)); j++) { if(i%j==0) { pass=1; break; } } if(pass==1); else { count++; sum=sum+i; } if(count==n) break; } return sum; } void main() {  while(1)  {   clrscr();   int n;   printf("Enter number of prime values");   scanf("%d",&n);   printf("Total of starting %d prime values is %d",n,sum(n));   getch();   if(n==99) exit(1);  } }  /*==========================6 April, 2013 2:00 PM==========================*/ Posted by Mangi Lal Sharma at 4/06/2013 04:43:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Saturday, 9 March 2013 Count reapetation number of unique values of an variety (Sort equal higher occurance of values) /* A program to summate no. of uniqe values of an variety implemented logic can be useful anywhere- where we required count no. of same rate books in a library e.g. 250$: 3books 300$: 4books 34$: 5books Date: 9/3/2013 10:05pm Author: Mangilal Saraswat */ #include<stdio.h> #include<conio.h> void main() {  clrscr();  int i,j,k,done,a[10],b[10],c[10];  i=0; j=0; k=0; done=0;  printf("Enter array:\n");  for(i=0;i<10;i++)  {   scanf("%d",&a[i]);   c[i]=0;  }  for(i=0; i<10; i++)  {   for(j=0;j<k;j++)   {    if(a[i]==b[j])    {     b[j]=a[i];     c[j]=c[j]+1;     done=1;    }   }   if(done==0)   {    b[k]=a[i];    c[k]=c[k]+1;    k=k+1;   }   done=0;  }  for(j=0;j<k;j++)  {   printf("value: %d\t",b[j]);   printf("times: %d\n",c[j]);  }  getch(); } Posted by Mangi Lal Sharma at 3/09/2013 11:46:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Sunday, 23 December 2012 Determine ASCII value for a inputted key/character /* compiler- Turbo c++ author- Mangilal Sharma --------------------------------------------------------*/ /* A program to determine ASCII value for a input key. */ #include <stdio.h> #include <conio.h> #include <bios.h> int getkey(void); void main() {  int x;  clrscr();  printf("Enter any Key: ");  x=getkey();  printf("\nASCII VALUE  OF ENTERED KEY IS: %d",x);  getch(); } int getkey(void) {  int key, lo, hi;  key = bioskey(0);  lo  = key & 0X00FF;  hi  = (key & 0XFF00) >> 8;  return((lo == 0) ? hi + 256 : lo); }  /*=========================30Nov.,2011=============================*/ Posted by Mangi Lal Sharma at 12/23/2012 11:39:00 pm No comments: Links to this post Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Wednesday, 28 November 2012 Merge Sort algorithm //Merge Sort algorithm implementation. #include<stdio.h> #include<conio.h> int z=1; void merge(int a[], int low, int high, int mid) {  printf("\nStep %d:\t",z++);  int i,j,k,c[50];  i=low;  j=mid+1;  k=low;  while((i<=mid) && (j<=high))  {   if(a[i]<a[j])   {    c[k]=a[i];    k++;    i++;   }   else   {    c[k]=a[j];    k++;    j++;   }  }  while(i<=mid)  {   c[k]=a[i];   k++;   i++;  }  while(j<=high)  {   c[k]=a[j];   k++;   j++;  }  for(i=low;i<k;i++)  {   a[i]=c[i];   printf("%d\t",a[i]);  } } void merge_sort(int a[], int low, int high) {  int mid;  printf("\n High: %d, Low: %d, mid: %d\n\n",high,low,((high+low)/2));  if(low<high)  {   mid=(low+high)/2;   merge_sort(a, low, mid);   merge_sort(a, mid+1, high);   merge(a, low, high, mid);  } } void main() {  int a[10],n;  clrscr();  printf("Enter No. of Items to insert: ");  scanf("%d",&n);  for(int i=0;i<n;i++)  scanf("%d",&a[i]);  merge_sort(a,0,n-1);  getch(); } //program written by Mars. Posted by Mangi Lal Sharma at 11/28/2012 03:26:00 pm No comments: Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab, DAA Lab Quick Sort algorithm with time complexity numbering //A program to implement Quick Sort algorithm.Moreovercalculate time complexity. #include<stdio.h> #include<conio.h> int x,r,p,a[20],i,j,n,temp,count=0; int partition(int p,int r) {  x=a[r];  i=p-1;  for(j=p;j<=r-1;j++)  {   if(a[j]<=x)   {    i=i+1;    temp=a[i];    a[i]=a[j];    a[j]=temp;count+4;   }   count++;   }    temp=a[i+1];    a[i+1]=a[r];    a[r]=temp;    count+3;  return(i+1); } void quick_sort(int p,int r) {  int q;  if(p<r)  {   q=partition(p,r);   quick_sort(p,q-1);   quick_sort(q+1,r);  } } void main() { textbackground(1);  clrscr();  printf("Enter no.of values: ");  scanf("%d",&n);  for(i=1;i<=n;i++)  {   printf("value %d:",i);   scanf("%d",&a[i]);   count++;  }  p=1;  r=n;  quick_sort(p,r);  printf("Sorted using Quick Sort:-\n");  for(i=1;i<=n;i++)  {   printf("%d\t",a[i]);count++;  }  printf("\nEs algo ki complexity '%d' hai...\ntumhare ki kitni hai",count);  printf("\n Enter tumhari algo complexity: ");  scanf("%d",&i);  if(i<count) printf("\nMA KASAM,Tumhari algo meri algo se acchi hai");  else printf("\nMA KASAM,Meri algo tumhari algo se acchi  hai");  getch(); } //program written by Mars. Posted by Mangi Lal Sharma at 11/28/2012 03:23:00 pm No comments: Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab, DAA Lab Bubble sort algorithm with time complexity numbering //Bubble sort algorithm implementation.Moreovercalculate time complexity. #include<stdio.h> #include<conio.h> void main() {  int a[100],temp,i,j,n,count;  count=0;count++;  printf("Bubble Sort\nEnter total no. of values: ");  {   scanf("%d",&n);   count++;  }  printf("Enter the values:-\n");  for(i=0;i<n;i++)  {   scanf("%d",&a[i]);   count++;  }  for(i=0;i<n;i++)  {   for(j=i;j<n;j++)   {    if(a[j]<a[i])    {     temp=a[j];count++;     a[j]=a[i];count++;     a[i]=temp;count++;    }    count++;   }   count++;  }  printf("Bubble-Sort result:-\n");  for(i=0;i<n;i++)  {   printf("%d\t",a[i]);   count++;  }  printf("\nTime Complexity is: %d",count);  getch(); } //program written by Mars. Posted by Mangi Lal Sharma at 11/28/2012 03:19:00 pm 5 comments: Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab, DAA Lab Position and value of smallest number //Position and value of smallest number in an variety #include<stdio.h> #include<conio.h> void main() {  clrscr();  int array[100],small=32767,n,loc=-1;  printf("Enter no. of values: ");  scanf("%d",&n);  printf("Enter Values:\n");  for(int i=0;i<n;i++)  {   printf("value %d: ",i+1);   scanf("%d",&array[i]);   if(array[i]<small)   {    small=array[i];    loc=i;   }  }  printf("Smallest Value is: %d\n",small);  printf("Position of smallest value: %d",loc+1);  getch(); } //program written by Mars. Posted by Mangi Lal Sharma at 11/28/2012 03:15:00 pm No comments: Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Program without header files program 1 void main() {  int a,b;  a=10;  b=5;  a=a+b; } program 2 int main() {  int a,b;  a=10;  b=5;  a=a+b;  return a; } program 3 char main() {  char a,b;  a=10;  b=5;  a=a+b;  return a; } Posted by Mangi Lal Sharma at 11/28/2012 01:58:00 am 2 comments: Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C vital lab Older Posts Home Subscribe to: Posts (Atom) Labels DSA Lab (20) C vital lab (16) OS Lab (12) DAA Lab (7) Graphics Lab (5) C++ vital lab (4) Attention (3) Compiler Lab (3) FORUM (1) Problems (1) Welcome (1) Feedjit Feedjit Live Blog Stats About Me Mangi Lal Sharma View my well-constructed profile My other blogs mangilalsaraswat.blogspot.com Total Pageviews Get My Help To Write Your Program mangilalsharma Fiverr Seller Main Skills: WordPress, C, C++, Java, PHP. I have wits in WordPress 5 years, C 8 years, C++ 7 years, Java 5 years and PHP 5 years. My services contains everything related to websites and desktop software. Blog Archive ▼  2015 (3) ▼  September (3) Factset Question: Subarray of k Size from aVariety... C program for User specified Custom atoi Function Co... C Program to Demonstrate use of atoi Function ►  2014 (3) ►  November (3) ►  2013 (9) ►  July (1) ►  June (6) ►  April (1) ►  March (1) ►  2012 (50) ►  December (3) ►  November (47) Flagcounter Copyright by world-of-c-programming.blogspot.com. Simple theme. Powered by Blogger.