Thursday, July 28, 2011

A C program that can convert Fahrenheit to degree Celsius using while loop


This is the program that will print and convert from 1 to 10 Fahrenheit to degree Celsius using the "WHILE LOOP" ,output will be the simple.

C Program:-

#include<stdio.h>
#include<conio.h>
void main(void)
{
int farinhiet=1;
float degree;
clrscr();
while(farinhiet<=10)
{
degree=(farinhiet-32)*5/9;
printf("\n\nfarinhiet=%d          degree=%f  ",farinhiet,degree);
farinhiet++;
}
getch();
}

A C program that can find a table using While loop

As we have done the same program of a table using the "FOR LOOP" but we can also make that program using the "WHILE LOOP" it is also very easy and simple and the output of this program is same like we did in the "FOR LOOP" table program so I will not mention the output.

C Program:-


#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int tbl,count=1;
printf("Enter the number which you want to print the table\n\n");
scanf("%d",&tbl);
while(count<=20)
{
printf("\n\n%2d   X   %2d= %3d",tbl,count,tbl*count);
count++;
}
getch();
}

Tuesday, July 26, 2011

Top 10 Richest Peoples in the world

1.William Bill Gates (C0-founder of Microsoft Corporation) : $59 billion dollars
2.Warren Buffet (Major investor in companies like GeicoDairy Queen & Coca-Cola) : $52 billion dollars
3.Sheldon Adelson (Chief of Las Vegas Sands) : $28 billion dollars
4.Lawrence Ellison (CEO of Oracle Software) : $26 billion dollars
5.Sergey Brin & Larry Page (Co-founders of Google Inc.) : $18.5 billion dollars each
6.Kirk Kerkorian (Owner of MGM Mirage)$18 billion dollars
7.Michael Dell (CEO of Dell Computers) : $17.2 billion dollars
8.Charles Koch & David Koch (Sons of Fred C. Koch)$17 billion dollars each

9.Paul Allen (C0-founder of Microsoft Corporation): $16.8 billion dollars
10.Christy Walton & family (Founder of the biggest retail store, Wal-Mart) : $16.3 billion dollars
  

Introduction to "WHILE LOOP" in C and C++ programming language

While Loop in C and C++:-
                                                                     "While loop" is a very important  loop in C and C++ programming language it is very similar to "FOR LOOP" the only difference between FOR and WHILE loop is that, that In while loop we do not know the number of repetitions it depends on any type of condition but for loop do not depend on any type of condition a user is aware in advance of the numbers of the repetitions.
The syntax of "While Loop" is given below.

while(condition)
      {

       Body of While loop(block of statements);  

      }

The program related to "While Loop" will be given in the upcoming posts.

Monday, July 25, 2011

A C program that print 1 to 50 by FOR loop

This is a program in which we use the concept of "Nested FOR LOOP" for printing the numbers from 1 to 50 and 10 digits in each line.
C Program:-



#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int n,m;
for(n=1;n<=50;n+=10)
{
printf("\n\n");
for(m=n;m<n+10;m++)
printf("%d\t",m);
}
getch();
}

Output:-
                     This program uses the concept of nested for loop and nested means loop inside a loop now in that type of case first it takes 1 value of upper loop and then execute the whole loop inside its body then again return to take the another value so in that way numbers from 1 to 50 will be printed and and after 10 digits automatically comes to new line.

Sunday, July 24, 2011

A C program that Is a LOVE CALCULATOR

C Program:-



#include<stdio.h>
#include<conio.h>
void main(void)
{


clrscr();
int n,m;
char name1,name2,name3,name4,name5,name6,name7,name8,name9,name10,name11,name12,name13,name14,name15;
int avg;
clrscr();
printf("Enter your name and then press enter and enter your partener name\n\n");
scanf("%c",&name1);
scanf("%c",&name2);
scanf("%c",&name3);
scanf("%c",&name4);
scanf("%c",&name5);
scanf("%c",&name6);
scanf("%c",&name7);
scanf("%c",&name8);
scanf("%c",&name9);
scanf("%c",&name10);
scanf("%c",&name11);
scanf("%c",&name12);
scanf("%c",&name13);
scanf("%c",&name14);
scanf("%c",&name15);
avg=(name1+name2+name3+name4+name5+name6+name7+name8+name9+name10+name11+name12+name13+name14+name15)/15;
if((avg%2)==0)
avg=avg-39;
if((avg%7)==0)
avg=avg-18;
if((avg%5)==0&&avg<56)
avg=avg+45;
clrscr();
printf("\n\nYour love percentage is %d",avg);
if(avg<40)
printf("\n\nTry to Increase your love toooooooooo bad......");
if(avg>=40&&avg<=60)
printf("\n\nHmmmmm well your love is soo soo improve it.........");
if(avg>60&&avg<=90)
printf("\n\nCongtars....V.good...keep it up");
if(avg>90&&avg<=99)
printf("\n\nWOW GREAT..........Fantastic........your next goal is to acchive full 100.......ok");
if(avg==100)
printf("\n\nPERFECT Made for each other true love");
getch();

}

NOTE:-
                    This program is very interesting program just copy paste this program in turbo C and lets see what happen................. :-) 

A C program that Will print the number.

This is the C language Program that will take the input a number form the user and then print the natural numbers up to that number, you can make it in many ways time we use FOR LOOP it is also very simple method.

C Program:-



#include<stdio.h>
#include<conio.h>
void main(void)
{
int nmr,n;
clrscr();
printf("Enter the number");
scanf("%d",&nmr);
for(n=0;n<nmr;n++)
printf("%d\t",nmr);
getch();
}


Output:-
                   Enter the number=5
                   1     2     3     4     5


NOTE:-
          I do use parentheses in the for loop that is because when we have only one statement inside the body of for loop then there is no need to use parentheses.

Saturday, July 23, 2011

Person of The Year 2010


On the afternoon of Nov. 16, 2010, Mark Zuckerberg was leading a meeting in the Aquarium, one of Facebook's conference rooms, so named because it's in the middle of a huge work space and has glass walls on three sides so everybody can see in. Conference rooms are a big deal at Facebook because they're the only places anybody has any privacy at all, even the bare minimum of privacy the Aquarium gets you. Otherwise the space is open plan: no cubicles, no offices, no walls, just a rolling tundra of office furniture. Sheryl Sandberg, Facebook's COO, who used to be Lawrence Summers' chief of staff at the Treasury Department, doesn't have an office. Zuckerberg, Facebook's CEO and co-founder and presiding visionary, doesn't have an office.
The team was going over the launch of Facebook's revamped Messages service, which had happened the day before and gone off without a hitch or rather without more than the usual number of hitches. Zuckerberg kept the meeting on track, pushing briskly through his points — no notes or whiteboard, just talking with his hands — but the tone was relaxed. Much has been made of Zuckerberg's legendarily awkward social manner, but in a room like this, he's the Silicon Valley equivalent of George Plimpton. He bantered with Andrew "Boz" Bosworth, a director of engineering who ran the project. (Boz was Zuckerberg's instructor in a course on artificial intelligence when they were at Harvard. He says his future boss didn't do very well. Though, in fairness, Zuckerberg did invent Facebook that semester.) Apart from a journalist sitting in the corner, no one in the room looked over 30, and apart from the journalist's public relations escort, it was boys only.
The door opened, and a distinguished-looking gray-haired man burst in — it's the only way to describe his entrance — trailed by a couple of deputies. He was both the oldest person in the room by 20 years and the only one wearing a suit. He was in the building, he explained with the delighted air of a man about to secure ironclad bragging rights forever, and he just had to stop in and introduce himself to Zuckerberg: Robert Mueller, director of the FBI, pleased to meet you.
They shook hands and chatted about nothing for a couple of minutes, and then Mueller left. There was a giddy silence while everybody just looked at one another as if to say, What the hell just happened?
It's a fair question. Almost seven years ago, in February 2004, when Zuckerberg was a 19-year-old sophomore at Harvard, he started a Web service from his dorm. It was called Thefacebook.com, and it was billed as "an online directory that connects people through social networks at colleges." This year, Facebook — now minus the the — added its 550 millionth member. One out of every dozen people on the planet has a Facebook account. They speak 75 languages and collectively lavish more than 700 billion minutes on Facebook every month. Last month the site accounted for 1 out of 4 American page views. Its membership is currently growing at a rate of about 700,000 people a day.
What just happened? In less than seven years, Zuckerberg wired together a twelfth of humanity into a single network, thereby creating a social entity almost twice as large as the U.S. If Facebook were a country it would be the third largest, behind only China and India. It started out as a lark, a diversion, but it has turned into something real, something that has changed the way human beings relate to one another on a species-wide scale. We are now running our social lives through a for-profit network that, on paper at least, has made Zuckerberg a billionaire six times over.
Facebook has merged with the social fabric of American life, and not just American but human life: nearly half of all Americans have a Facebook account, but 70% of Facebook users live outside the U.S. It's a permanent fact of our global social reality. We have entered the Facebook age, and Mark Zuckerberg is the man who brought us here.
Zuckerberg is part of the last generation of human beings who will remember life before the Internet, though only just. He was born in 1984 and grew up in Dobbs Ferry, N.Y., the son of a dentist — Painless Dr. Z's slogan was, and is, "We cater to cowards." Mark has three sisters, the eldest of whom, Randi, is now Facebook's head of consumer marketing and social-good initiatives. It was a supportive household that produced confident children. The young Mark was "strong-willed and relentless," according to his father Ed. "For some kids, their questions could be answered with a simple yes or no," he says. "For Mark, if he asked for something, yes by itself would work, but no required much more. If you were going to say no to him, you had better be prepared with a strong argument backed by facts, experiences, logic, reasons. We envisioned him becoming a lawyer one day, with a near 100% success rate of convincing juries."

A C program that can print Table of any number

This is very important and basic program and we can make a table both with the help of for loop of with the help of while loop. This is the coding of this C language Program.

C Program:-



#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int tbl,count;
printf("Enter the number which you want to print the table=\n\n");
scanf("%d",&tbl);
for(count=1;count<=5;count++)
printf("\n\n%2d   X   %2d= %3d",tbl,count,tbl*count);
getch();
}

OUTPUT:-

Enter the number which you want to print the table= 5

 5  X  1= 5
 5  X  2=10
 5  X  3=15
 5  X  4=20
 5  X  5=25

Note:-
           In this program we first of all takes an input from the user that which number he want to make the table of and the we use a for loop and starts it from one and end it any number (number at which you want to print table) and then simply print it line by line in body of for loop and makes  the formula of finding it.

A C program that find sum from 1 to 10

This is the program which uses the help of "For loop" to find the sum of the numbers from 1 to 10.

C Program:-



#include<stdio.h>

#include<conio.h>
void main(void)
{
clrscr();
int n,sum;
for(n=1;n<10;n++)
sum+=n;
printf("\n\nThe total from 1 to 10 is %d",sum);
getch();
}

Same Program in another Way:-

#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int n,sum=0;
for(n=1;n<10;n++)
{
sum=sum+n;
printf("\n\ncount= %d  total= %d  ",n,sum);
}
printf("\n\nThe total from 1 to 10 is %d",sum);
getch();
}

Same program with setting the column width:-


#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int count=1,sum=0;
while(count<=10)
{
sum+=count;
printf("\n\n count=%2d    sum= %2d",count,sum);
count++;
}
getch();
}

Note:-
              In this program we set the column width by "%2d" this with set the column with two digit place.

Friday, July 22, 2011

World Leaders Attend G8 Summit 2011 in Deauville

     David Cameron, U.K. prime minister (L) listens to Mark Zuckerberg, founder of Facebook Inc. (R) during the internet session of the G8 summit on May 26, 2011 in Deauville, France. Heads of the world's wealthiest nations are meeting in Deauville, France, for the G8 summit to discuss various security, aid and trade issues, including the "Arab Springs", nuclear safety and climate change.


UK Prime Minister David Cameron Encouraging Mark zukerberg  


Mark Zukerberg having friendly talk 

Mark Zukerberg in a group photo

Mark Zukerberg smiling

Mark Zukerberg face to face with UK Prime Minister

UK Prime Minister Coming to Attend the conference

An Example of "FOR LOOP" in C and C++

As sometimes in a program we need to print same thing over and over or like ten times for example we can make a program that will a line ten times with the help of FOR LOOP.


C Program:-
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
int num;
for(num=1;num<=10;num++)
                                {
                                 printf("\n This is a C language program") ;
                                 }
getch();
}


Output:-
                      This is a C language program
                      This is a C language program
                      This is a C language program
                      This is a C language program
                      This is a C language program 
                      This is a C language program 
                      This is a C language program
                      This is a C language program
                      This is a C language program 
                      This is a C language program


NOTE:-
             As you can see in this program in the for loop "num=1" is the starting value and "num<=10" is the ending value and "num++" means the increment of 1 as in recent posts i have explained you the increment and decrements operators in C and C++ programming language.

Introduction to "FOR LOOP" in C and C++ programming language

The general form of the "For loop" statement is

for(exp1;exp2;exp3)
                          {
                           
                           The body of loop (block of statements)


                          } 
It is executed as follow :
  1. Exp1 is evaluated.
  2. Exp2 is evaluated.If it is true (non zero), the body of the for loop is executed, followed by exp3 and this step(2) is repeated. If exp2 is false (zero), the loop terminates and the execution continues with the next statements if any after the for loop.

Thursday, July 21, 2011

Introduction to "LOOPS" in C and C++ language

A loop is a mechanism that enables you to execute the same sequence of the statements repeatedly until a particular condition is met. The statements inside the loop is sometimes called iteration statements.

The loops can be of three types.
  1. sequential
  2. repetition
  3. section
For example you might want to.

  1. Execute a loop a given number of times.
  2. Execute the loop until a given value exceeds another value.
  3. Execute a loop until a particular character is entered.
There are Generally three types of loops in C and C++ programming language.
  1. FOR LOOP
  2. WHILE LOOP
  3. DO WHILE LOOP
We use all these loops to save the time and efforts of the programmer because other wise if we want to write something ten times in the C or C++ program than we have to write it ten times but with the help of loop we will only have to write it once and apply the loop and rest of the work will be done automatically.





















Mark zukerberg at Facebook headquarters

Facebook CEO Mark Zuckerberg speaks during a news conference at Facebook headquarters July 6, 2011 in Palo Alto, California. Zuckerberg announced new features that are coming to Facebook including video chat and a group chat feature.