Showing posts with label programs. Show all posts
Showing posts with label programs. Show all posts

Saturday, February 18, 2017

How to Control LED lights through Arduino Uno

How to Control LED lights through Arduino Uno

This Program will show you that how to control LED Lights through the Arduino Uno. This will show you all connection step by Step in very Simple Manner. Definitely you will understand the program after watching this video.

Click on the below link to see the video for how to Control LED lights through Arduino Uno:


My Twitter Account :
https://twitter.com/rakesh_prof

My Facebook Account:
https://www.facebook.com/AsstProfRakeshRoshan

My Blog:
https://computersciencebyrakesh.blogspot.in/

Monday, September 12, 2016

List of Important Programs in C language

/*1. Program to calculate the factorial of a Number*/
#include<stdio.h>
int main()
{
int fact=1,i,Num;
printf("Enter the value of Num:");
scanf("%d",&Num);
for(i=2;i<=Num;i++)
    fact=fact*i;
     printf("\nFactorial of %d is %d",Num,fact);
return 1;  
}

/*Program to Check whether the number is prime or not*/
#include<stdio.h>
int main()
{
int flag=1,i,Num;
printf("Enter the value of Num:");
scanf("%d",&Num);
for(i=2;i<Num;i++)
{
  if ((Num%i)==0)
  {
   flag=0;
    }
}
     if(flag==1)
         printf("Prime Number");
    else
         printf("Not Prime Number");
return 1;  
}
/*Optimized Program to Check whether the number is prime or not*/
#include<stdio.h>
int main()
{
int flag=1,i,Num;
printf("Enter the value of Num:");
scanf("%d",&Num);
for(i=2;i<Num/2;i++)
{
  if ((Num%i)==0)
  {
   flag=0;
    }
}
     if(flag==1)
         printf("Prime Number");
    else
         printf("Not Prime Number");
return 1;  
}
/*Program to print the pattern

*
**
***
****
*****

*/
#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 1;  
}

/*Program to print the pattern

    *
   * *
  * * *
 * * * *
* * * * *

*/
#include<stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(k=1;k<6-i;k++)
   printf(" ");
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
return 1;  
}

/*Program to print the pattern

A
B B
C C C
D D D D
E E E E E

*/
#include<stdio.h>
int main()
{
int i,j,k;
for(i=65;i<=69;i++)
{
  for(j=65;j<=i;j++)
{
printf("%c ",i);
}
printf("\n");
}
return 1;  
}

/*Program to print the pattern

A
A B
A B C
A B C D
A B C D E

*/
#include<stdio.h>
int main()
{
int i,j,k;
for(i=65;i<=69;i++)
{
  for(j=65;j<=i;j++)
{
printf("%c ",j);
}
printf("\n");
}
return 1;  
}