Appeared in-1972 Designed by-Dennis Ritchie Latest Songs and Hd Videos(comingsoon)
Saturday, 18 August 2012
BEST KICK TAKER
Labels:
c programming,
Cr,
CR7,
Gerrard,
Messi,
Pirlo,
Ronaldo,
Simple Interest Program
Friday, 17 August 2012
Find factorial of given number
Write a C program to find the factorial of given number?
#include<stdio.h>
void main()
{
int i,f=1,num;
clrscr ();
printf("Enter a number: ");
scanf("%d",&num);
for(i=1;i<=num;i++)
f=f*i;
printf("Factorial of %d is: %d",num,f);
getch ();
}
Tags: factorial of given number,c programming,c
Thursday, 16 August 2012
first N even number program
Write a program to print first N even Number.
Answer:
#include <stdio.h>
#include <stdlib.h>
void main ()
{
int i,n;
clrscr ();
printf(" Program to print out the first n even numbers \n");
for (i=0; i<=20; i+=2)
{
printf (" %d ",i);
}
printf("\n");
getch ();
}
Answer:
#include <stdio.h>
#include <stdlib.h>
void main ()
{
int i,n;
clrscr ();
printf(" Program to print out the first n even numbers \n");
for (i=0; i<=20; i+=2)
{
printf (" %d ",i);
}
printf("\n");
getch ();
}
Simple Interest Program
Write a program to calculate Simple Interest.
Answer:
#include<stdio.h>
#include<conio.h>
void main ()
{
int p, n;
float r, si;
printf(" Enter the values of p, n, r: ");
scanf("%d %d %f", &p, &n, &r);
si=p*n*r/100;
printf("%f", si);
getch ();
}
Answer:
#include<stdio.h>
#include<conio.h>
void main ()
{
int p, n;
float r, si;
printf(" Enter the values of p, n, r: ");
scanf("%d %d %f", &p, &n, &r);
si=p*n*r/100;
printf("%f", si);
getch ();
}
Saturday, 11 August 2012
All Odd and Even Number
Write a program to find all Even and Odd Number Between 100.
Answer :
#include<stdio.h>
#include<conio.h>
int i:
void main();
{
int n=99;
clrscr ();
printf("All odd Number\n\n");
for (i=1;i<=n;i=i+2)
printf("%d",i);
printf("\n\nAll Even Number\n\n");
for (i=2;i<=100;i+=2)
printf("%d",i);
getch ();
}
Result:
Answer :
#include<stdio.h>
#include<conio.h>
int i:
void main();
{
int n=99;
clrscr ();
printf("All odd Number\n\n");
for (i=1;i<=n;i=i+2)
printf("%d",i);
printf("\n\nAll Even Number\n\n");
for (i=2;i<=100;i+=2)
printf("%d",i);
getch ();
}
![]() |
cprogramminglanguagehistory.blogspot.com |
![]() |
cprogramminglanguagehistory.blogspot.com |
Write a program which print Hi when the user put number greater than 50 and print BYE when the Number is smaller than 50.
Write a program which print Hi when the user put number greater than 50 and print BYE when the Number is smaller than 50.
#include<stdio.h>
#include<conio.h>
void main ()
{
int n;
clrscr ();
printf("Enter any Number");
scanf("%d",&n);
if (n>50)
printf("Hi");
else
printf("BYE");
getch ();
}
#include<stdio.h>
#include<conio.h>
void main ()
{
int n;
clrscr ();
printf("Enter any Number");
scanf("%d",&n);
if (n>50)
printf("Hi");
else
printf("BYE");
getch ();
}
![]() |
cprogramminglanguagehistory.blogspot.com |
![]() |
cprogramminglanguagehistory.blogspot.com |
Write a program which ask thier age and give output like this.if age is between 0 to 2 it outputs "Still a baby", 3 to 12 "Children", 13 to 17 "Teenager", 18 to 26 "Young Adult", 27 to 39 "Middle age", 40 to 79 "Grand Parents", 80 and higher .
Write a program which ask thier age and give output like this.if age is between 0 to 2 it outputs "Still a baby", 3 to 12 "Children", 13 to 17 "Teenager", 18 to 26 "Young Adult", 27 to 39 "Middle age", 40 to 79 "Grand Parents",above 80"WOW".
#include <stdio.h>
#include <conio.h>
int age;
void main() {
clrscr();
printf("Enter your age: ");
scanf("%d", &age);
if (age>0 && age<=2) printf("Still a baby");
else if (age>=3 && age<=12) printf("Children");
else if (age>=13 && age<=17) printf("Teenager");
else if (age>=18 && age<=26) printf("Young Adult");
else if (age>=27 && age<=39) printf("Middle Age");
else if (age>=40 && age<=79) printf("Grand Parents");
else printf("Wow");
getch();
}
#include <stdio.h>
#include <conio.h>
int age;
void main() {
clrscr();
printf("Enter your age: ");
scanf("%d", &age);
if (age>0 && age<=2) printf("Still a baby");
else if (age>=3 && age<=12) printf("Children");
else if (age>=13 && age<=17) printf("Teenager");
else if (age>=18 && age<=26) printf("Young Adult");
else if (age>=27 && age<=39) printf("Middle Age");
else if (age>=40 && age<=79) printf("Grand Parents");
else printf("Wow");
getch();
}
Write a program which gives addtion of 3 numbers.
Open TC.exe
Click on File and then Click on New.
then type.
#include<stdio.h>
#include<conio.h>
void main ()
{
int a,b,c,d ;
clrscr ();
clrscr ();
printf("Enter any three number");
scanf("%d%d%d%d",&b,&c,&d);
a=b+c+d
printf("Total sum = %d",a);
getch();
Write a program to find out whether number is Negative or positive.
Open TC.exe
Click on File and then Click on New.
then type.
#include<stdio.h>
#include<conio.h>
void main ()
{
clrscr ();
int n ;
printf("Enter any Number");
scanf("%d",&n);
if (n>0)
printf("%d is Positive");
else
printf("%d is Negative");
getch();
}
![]() |
cprogramminglanguagehistory.blogspot.com |
result:
![]() |
cprogramminglanguagehistory.blogspot.com |
Write a program to find whether number is Even or Odd.
Open TC.exe
Click on File and then Click on New.
then type.
#include<stdio.h>
#include<conio.h>
void main ()
{
clrscr ();
int n ;
printf("Enter any integer");
scanf("%d",&n);
if (n%2==0)
printf("%d is Even");
else
printf("%d is odd");
getch();
}
![]() |
cprogramminglanguagehistory.blogspot.com |
result :
![]() |
cprogramminglanguagehistory.blogspot.com |
Now here's your homework:
Write a program to find out whether number is Negative or positive.
If you Know this answer comment below with your answer and if you don't know comment Below.
Subscribe to:
Posts (Atom)