Decrease Character Pyramid

Friday, April 11, 2014

0 comments
Q. Write a C program to print the following decrease character pyramid as:

EEEEE
DDDD
CCC
BB
A

Ans.

/*c program for decrease number pyramid*/
#include<stdio.h>
int main()
{

 char ch,p,r,c;
 printf("Enter any character : ");
 scanf("%c", &ch);
 if(ch>=a && ch<=z)
    ch=ch-32;
 p=ch;
 for(r=A; r<=ch; r++,p--)
 {
   for(c=A; c<=p; c++)
      printf("%c",p);
   printf("
"
);

 }
 getch();
 return 0;
}

/**************************************************************
The output of above program would be:
***************************************************************/


Output for decrease character pyramid C program
Figure: Screen shot for decrease character pyramid C program
Read More..

Number Pryamid By Function

Thursday, April 10, 2014

0 comments
Q. Write a C program to print the following triangle using function.

 1
 2 3
 4 5 6
 7 8 9 1
 2 3 4 5 6

Ans.

/*C program for number pyramid using function*/
#include<stdio.h>
void pyramid(int );
int main()
{
 int num;
 printf("Enter the number of rows : ");
 scanf("%d", &num);
 pyramid(num);
 return 0;
}

void pyramid(int n)
{
 int r,c,x=1,y=1;
 for(r=1; r<=n; r++)
 {
  for(c=1; c<=r; c++,x++)
  {
    if(x<=9)
       printf(" %d",x);
    else
    {
       printf(" %d",y);
       y++;
    }
  }
  printf("
"
);
 }
}

The output of above program would be:

Output of create number pyramid using function C program
Figure: Screen shot for number pyramid
using function C program

Read More..

Odd Number Triangle

Wednesday, April 9, 2014

0 comments
Q. Write a C program to print the following number triangle as:

 0
 1 0 1
 2 1 0 2 1
 3 2 1 0 1 2 3

Ans.

/*c program for odd number triangle*/
#include<stdio.h>
int main()
{
 int num,r,c,q,s;
 printf("Enter ending number : ");
 scanf("%d", &num);
 for(r=0; r<=num; r++)
 {
  for(c=0,s=r; c<=r; c++,s--)
     printf(" %d",s);
  for(q=1; q<=r; q++)
     printf(" %d",q);
  printf("
"
);

 }
 getch();
 return 0;
}

The output of above program would be:

Output of number triangle C program
Figure: Screen shot for number triangle C program

Read More..

Learn How To Store Your Boat For Winter With St Petersburg Marinas

0 comments
By Lance Aldinger


It is great to have a boat and enjoy the fun and relaxation that this wonderful pastime brings. This is particularly so when the season permits it. During the winter months, sailing may not be possible so it is advisable that you have a place to store your boat in order to avoid damage when not in use. Consult with a St. Petersburg marinas company for the solutions they can offer.

Since you will not be making much use of your boat during winter, it is vital that you keep it secure. It must be stored properly and safely to protect it from the harmful effects of sea water and natural elements.

Having the boat dry stored is easily done and well worth its costs. Leaving the vessel exposed will cause damage that is more expensive to repair than having it stored. It is for this reason that you should ensure the boat is fully protected during extended periods of no use.

Upon docking your sailing vessel where you will have it dry stored, a lift truck that is equipped for safe lifting will take it out of the water. The boat will be put into a storage rack designed specifically for this. It will be stored without contact to the ground. Storage in this manner is best as no damage is caused.

It would also be a good idea to catch up on regular maintenance and servicing while the boat is in storage. The professionals at your facility are trained to do all the necessary maintenance work for you. As such, your sailing vessel is returned to tip top shape.

You can be sure to have the most fun with your vessel by keeping it safe. It will be best to keep it safely stored during the winter months when not in use. With a St. Petersburg marinas company you will be able to get this service.




About the Author:



Read More..

Capture The Prankster With Reverse Cell Number Seek Out

Tuesday, April 8, 2014

0 comments
By Eirena Biafra


Understanding is half the battle. Once you understand if the business requiring money is real or not you can manage it accordingly. You can block their number or talk to them if it is your next-door neighbor. Most of the time, all it takes is a request from you and your phone company can block a number and business who demand payments are typically fraudsters. When you have the realities, you can choose how to manage it.

Innovation has actually now proceeded far enough that you no longer require a house or a name telephone number to get the info you need. This is great information. Envision being able to stop somebody from bothering you by finding out who their cell phone service provider is, along with their name, address and other details. In years past, people were not so fortunate. They had to experience the annoyance.

After you learn who is calling you, you can then decide what to do in order to ensure it stops. Understanding that it is a bad number to a company who is demanding you pay them can then be reported to the proper authorities. If it is your next-door neighbor, you can select or block the number to confront them about their calls. The choice is yours.

Just picture the capacity that you need to regulate those prank hire the middle of the night that awaken you or your household. If all they do is hang up on you without talking to you, it does not matter. As long as you have a phone with caller ID on it and you can see their telephone number, you can look for that number. You will learn instantaneously who you are dealing with.

It does not matter if their number is unlisted or not; with reverse cell number lookup you can still discover the necessary details. If they have been calling you at your home or on your mobile phone, you have the right to understand who they are. Whether they live across the nation or right next door you can discover who provided their cell phone service which enables them to bother you and your household.

Prank calls typically come from kids who want to play tricks on people. However, other times it is made use of to terrify you rather than just annoy you. This could be especially real if the individual on the various other end is a heavy breather. This can constantly spook your kids if they happen to respond to and it is commonly implied to do simply that. The prankster does not care what they do to your household. Use the tools you have in order to stop it before it ends up being more of a trouble.

There is no damage in discovering what you need to understand. It is definitely legal for you to stop the harassment and attempt. No one but you understands that it ares happening. No one however you can make it end. The only way you will stop it is to find out who is doing it to your family.

The amount of is it worth to you to make the prank calls stop? To be able to sleep a full night without having someone call and hang up on you? You can get a fundamental search result for no cost at all. If you need even more info to make the phone calls stop, there might be a small cost for using the reverse cell number search. If you are tired of the inconvenience though, this small charge may effectively be your finest acquisition in years.




About the Author:



Read More..

Quick Sort algorithm with time complexity calculation

0 comments

//A program to implement Quick Sort algorithm. Also calculate 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:-
");

 for(i=1;i<=n;i++)
 {
  printf("%d ",a[i]);count++;
 }
 printf("
Es algo ki complexity %d hai...
tumhare ki kitni hai",count);

 printf("
Enter tumhari algo complexity: ");

 scanf("%d",&i);
 if(i<count) printf("
MA KASAM,Tumhari algo meri algo se acchi hai");

 else printf("
MA KASAM,Meri algo tumhari algo se acchi  hai");

 getch();
}
//program written by Mars.
Read More..

Writting comments in C Programming

Monday, April 7, 2014

0 comments
Comments in C++
"Comments are usually consisting of words in C++ program which are the non-executable parts of program and compiler does not translate comments".
Types of comments
1) Single line comments 2) Multiple line comments
Single line comments:
It starts with two back slashes // and followed by your description line or word
For example: //this is a C++ program
Multiple line comments:
Multiple line comments are used when we want to write comments in multiple lines.
It starts with a slash followed by asterisk /* and ends with asterisk and slash */
For example:
/*C++ is an high level language and
I like it*/
Now,
Question is that why we use comments?
  • By using comments we increase readability of program.
  • Readers can understand more quickly the logic of program and working of program on every line.
  • C++ comments are one of the important feathers of C++ programming. They are very useful to explain not only working of program but every point of every line of program. Suppose if you are coding or typing a lengthy C++ program and you are using comment in this program during coding due to some reason you need to close your program and you save your incomplete program after some days when you find time to continue your work at first look when you look your code and also on comments line by line things are re call very quickly in your mind about your program. In this way you can start your coding again confidently. Comments help you to understand and remember the every line of your program.
  • On the other hand if you not use comments in your lengthy program and you have to start your code or program from line number 1500 to start your code you will re call your code and it is possible you may be confuse at the certain line of code that you have code yourself. Avoid from this confusing situation comments should always use in lengthy programs.
  • Let have a look to this page to gain about about comments.
  • http://msdn.microsoft.com/en-us/library/wfwda74e%28v=vs.80%29.aspx
Read More..

Copyright © 2014 Information Sharing | Powered By Blogger