Pages

Monday, 16 January 2017

C program to add n numbers

This c program add n numbers which will be entered by the user. Firstly user will enter a number indicating how many numbers user wishes to add and then user will enter n numbers. In the first c program to add numbers we are not using an array, and using array in the second code.

C PROGRAMMING CODE

#include 
 
int main()
{
int n, sum = 0, c, value;
 
printf("Enter the number of integers you want to add\n");
scanf("%d", &n);
 
printf("Enter %d integers\n",n);
 
for (c = 1; c <= n; c++)
{
scanf("%d",&value);
sum = sum + value;
}
 
printf("Sum of entered integers = %d\n",sum);
 
return 0;
}

C program to find HCF and LCM


C program to find hcf and lcm: The code below finds highest common factor and least common multiple of two integers. HCF is also known as greatest common divisor(GCD) or greatest common factor(gcf).

C PROGRAMMING CODE

#include 
 
int main() {
int a, b, x, y, t, gcd, lcm;
 
printf("Enter two integers\n");
scanf("%d%d", &x, &y);
 
a = x;
b = y;
 
while (b != 0) {
t = b;
b = a % b;
a = t;
}
 
gcd = a;
lcm = (x*y)/gcd;
 
printf("Greatest common divisor of %d and %d = %d\n", x, y, gcd);
printf("Least common multiple of %d and %d = %d\n", x, y, lcm);
 
return 0;
}

Factorial program in C


C code to find and print factorial of a number, three methods are given, first one uses for loop, second uses a function to find factorial and third using recursion. Factorial is represented using '!', so five factorial will be written as (5!), n factorial as (n!). Also
n! = n*(n-1)*(n-2)*(n-3)...3.2.1 and zero factorial is defined as one i.e. 0! = 1.

FACTORIAL PROGRAM IN C USING FOR LOOP

Here we find factorial using for loop.
#include 
 
int main()
{
int c, n, fact = 1;
 
printf("Enter a number to calculate it's factorial\n");
scanf("%d", &n);
 
for (c = 1; c <= n; c++)
fact = fact * c;
 
printf("Factorial of %d = %d\n", n, fact);
 
return 0;
}

C program to check leap year

C program to check leap year: c code to check leap year, year will be entered by the user.

C PROGRAMMING CODE

#include 
 
int main()
{
int year;
 
printf("Enter a year to check if it is a leap year\n");
scanf("%d", &year);
 
if ( year%400 == 0)
printf("%d is a leap year.\n", year);
else if ( year%100 == 0)
printf("%d is not a leap year.\n", year);
else if ( year%4 == 0 )
printf("%d is a leap year.\n", year);
else
printf("%d is not a leap year.\n", year);
 
return 0;
}

C program to perform Addition, Subtraction, Multiplication and Division


C program to perform basic arithmetic operations which are addition, subtraction, multiplication and division of two numbers. Numbers are assumed to be integers and will be entered by the user.

C PROGRAMMING CODE

#include 
 
int main()
{
int first, second, add, subtract, multiply;
float divide;
 
printf("Enter two integers\n");
scanf("%d%d", &first, &second);
 
add = first + second;
subtract = first - second;
multiply = first * second;
divide = first / (float)second; //typecasting
 
printf("Sum = %d\n",add);
printf("Difference = %d\n",subtract);
printf("Multiplication = %d\n",multiply);
printf("Division = %.2f\n",divide);
 
return 0;
}

C program to check Odd or Even




In mathematics, in decimal number system even numbers are divisible by 2 while odd are not so we can use modulus operator(%) which returns remainder, For example 4%3 gives 1 ( remainder when four is divided by three). Even numbers are of the form 2*p and odd are of the form (2*p+1) where p is is an integer.

C PROGRAM TO CHECK ODD OR EVEN USING MODULUS OPERATOR

#include
 
main()
{
int n;
 
printf("Enter an integer\n");
scanf("%d",&n);
 
if ( n%2 == 0 )
printf("Even\n");
else
printf("Odd\n");
 
return 0;
}

C program to add two numbers

C program to add two numbers: This c language program perform the basic arithmetic operation of addition on two numbers and then prints the sum on the screen. For example if the user entered two numbers as 5, 6 then 11 (5 + 6) will be printed on the screen.

C PROGRAMMING CODE

#include
 
int main()
{
int a, b, c;
 
printf("Enter two numbers to add\n");
scanf("%d%d",&a,&b);
 
c = a + b;
 
printf("Sum of entered numbers = %d\n",c);
 
return 0;
}

C program print integer




This c program first inputs an integer and then prints it. 
Input is done using scanf function and number is printed on screen using printf.
In c language we have data type for different types of data, for integer data it is int, for character date char, for floating point data it's float and so on.

C PROGRAMMING CODE

#include 
 
int main()
{
int a;
 
printf("Enter an integer\n");
scanf("%d", &a);
 
printf("Integer that you have entered is %d\n", a);
 
return 0;
}

C hello world program



C hello world program: c programming language code to print hello world. This program prints hello world, printf library function is used to display text on screen, '\n' places cursor on the beginning of next line, stdio.h header file contains declaration of printf function. 
The code will work on all operating systems may be its Linux, Mac or any other and compilers. To learn a programming language you must start writing programs in it and may be your first c code while learning programming.

HELLO WORLD IN C LANGUAGE

//C hello world example
#include
 
int main()
{
printf("Hello world\n");
return 0;
}
Purpose of Hello world program may be to say hello to people or the users of your software or application.

Saturday, 14 January 2017

How to add Unique Snow Falling Effect to Blogger

Most of blogger are use snow falling effect to their blog. It is a common trend all bloggers to in specific seasons.Snow falling effects are very famous in Christmas season. Sometime, evrn we search about snow falling effects for blogger, hard to get working versions.Therefore, today we will learn how to add snow falling effect to your blog.You can check our  previous snow effects tricks.



                                                                           Demo   

Awesome 3d Effect CSS Menu bar for Blogger


1. Go to Blogger Dashboard > Template

2. Find </head> tag
3. Paste below code just above it.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>        
<script src="http://preview.bloggertrix.com/bloggertrix_christmas/snow.js"></script>      <style>
img.bg {
        min-height: 100%;min-width: 1024px;
        width: 100%; height: auto;
        position: fixed; top: 0;left: 0;}
h1 {
font-family: 'Chelsea Market', cursive;
color: #FFF;font-size: 90px;text-align: center;line-height: 95px;font-weight: normal;
margin-top: 350px;text-shadow: 5px 5px 5px #000;
}
@media screen and (max-width: 1024px) { /* Specific to this particular image */
        img.bg { left: 50%;margin-left: -512px;   /* 50% */}
}
html, body {
font-family: Helvetica, Arial, sans-serif;font-size: 12px; line-height: 16px; padding: 0;
margin: 0;color: #333;
}
.bar {background-color: #111;color: #f0f0f0; box-shadow: 0px 0px 2px #333;
line-height: 25px;padding: 0px 20px;opacity: 0.7;
}
.bar:hover {opacity: 1;}
.bar a {color: #DDD;}
.bar a:hover {color: #FFFFFF;}
a { color: #CCC; text-decoration: none; }
a:hover { color: #FFFFFF; }
#canvas {border: 1px solid black;position: absolute;z-index: 10000; }
#flake {color: #fff;position: absolute; font-size: 25px;top: -50px;}
#page {position: relative;}
</style>
4.  Again find <body>
5. Paste below code after <body> tag.

<div id = "flake">&#10052;</div>
6. Now save your  Template  You are done. If you have any problem related to this snow falling effect. Just leave a comment.I will help you.

SEO Basics that Every Blogger Should Know

SEO (Search Engine Optimization) is a topic that no fresh blogger  can afford to disregard. SEO practices can not  only  radically  boost  a  blog’s visibility but can also effect  substantial  cost  and time economies as well. If you’ve just commenced  blogging and are unsure  of  how  to  conduct  an  SEO  campaign, the ensuing fundamental guidelines will point you in the right direction:




SEO Basics Tips For Blogger


1. Have a Top-Notch Title

Your blog title is the first element your reader views (via the search engine result) and thus merits
particular mention. It is imperative to construct a strong and engaging title to garner maximum visibility and reader clicks - tips in this context:

a)  Make your title appealing, inventive, persuasive, and grammatically impeccable.
b)  Try to place your main keywords near the commencement of the title for greater reach.
c)  Ascertain that your title is concise (preferably under 70 characters) to prevent search engines from
      excising it.

2. Utilize Superior and Versatile Content


Apart from the title, you ought to always host high-quality and comprehensive material on your blog.
Further tips in this regard:

a)  Steadfastly employ well-written, straightforward, and grammatically precise language.
b)  Strive to host content that educates and apprises readers. Not only would such content engender
       increased user sharing but it will also generate more sanguine search engine ratings. For this
       purpose, you should harness high-quality plugins and other online instruments.
c)  Incorporating videos, music clips, and podcasts is a prudent idea as makes for a more immersive
     reader experience.
d)  Remember to keep the material original as Google and other engines have a zero-tolerance
      plagiarism policy.
e)  Update frequently to obviate monotony and loss of readership.

3. Practice Intelligent Keyword Use

Keywords are principal SEO components that are immensely beneficial for blogging success. Ensure that:

a) Your choice of keywords is founded on what’s currently relevant and popular with readers.
b) Your keywords reflect your blog theme and philosophy closely.
c) You embed your keywords at strategic spots in your blog like the title, headline, and posts as also
     in links and metadata content.
d) The keywords feature prominently at the beginning of your posts and then at adequately-spaced
locations.


4. Focus on Link-Building

Extensive linking to your blog from other online portals can dramatically ratchet your readership.
Detailed advice in this context:

e) Ascertain that the portals you associate with are reputable and popular for heightened link traffic.
f) Make sure your anchor text is succinct and corresponds to your main keywords.
g) Invariably employing superlative blog content is best way to guarantee back-linking success. Good
content will ensure repeat readership as well.
h) Write guest columns in other blogs and embed them with your blog’s links.
i) You can even ingrain inbound links to and from your own blog for optimal visibility.
j) Do not try to purchase links as this is viewed as Google and other top search engines view this as an
unethical trade practice.


5. Boost Your Infrastructure

To safeguard high SEO ratings, ascertain that your blog framework possesses technically advanced
codes, plugins, and permalinks. A potent infrastructure will also make your blog pages load speedily
thereby delighting your readers.


6. Be Active Online


The more you post, guest-comment, and are active on social networking sites, the greater will be your
blog’s reputation and influence. Note that Google now considers social media success as the chief
parameter for top SEO ratings.


7. Go For Independent Operation

For best results you should attempt to host your blog independently and even have a personal domain
name. These moves may involve increased expenditure, but will definitely improve your blog’s cachet as search engines favor blogs with autonomous structures. When choosing hosting and domain name service providers ensure that they offer competitive rates, all-embracing administrative choices, good security, and round-the-clock support.

This is a guest post by Mark Bennett of Onlinecomcast.com, a site that offers savings and current
information on comcast phone for home cable and internet.a

10 Blogger tools for bloggers

 When we doing blogging. we have to use many more tools for different different works.If we search on the Google search  we can find various category of tools. I have some collection  of  tools site.its really helpful for blogger. I thought to share with you.

1.  blogflux.com
This is providing you everything you need to get your blog up and running. From a blog directory, to themes, stat tracking, and advanced services like our poll and quiz makers, Blogflux is the only resource you need to get your blog online 

2. htmlkit.com 
If you want to make favicon. It helps to make favicon by image.(Add favicon to your blog.)

3.feedburner.com
This helps to add Rss feed feature to your blog.

4 .flickr.com
Good place to share ans store your images.almost certainly the best online photo management and sharing application in the world

5. backpackit.com
Best place to  organizetodo, note,remindersand list easily and keep one place all the time.

Picasa is free photo editing software from Google that makes your pictures look great. 
Sharing your best photos with friends and family is as easy as pressing a button! 

7. gabbly.com
Live chat site for blogger. easy to chat with others


8. talkdigger.com
you can join this site and follow others and start conversation 

9. tinyurl.com
make your URL tiny. its really helpful

10. swicki.eurekster.com
new type of search engine for web community.it combine with wiki .

Enjoy with it.