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/

Introduction to Arduino Uno and different sensors

Introduction to Arduino Uno and different sensors

Introduction to Arduino Uno, Relays, Jumpers, LED Lights, Sensors(Ultrasonic, Sound, Gas, LDR), Bluetooth Module etc. This video introduced you about the hardware require for the projects by using Arduino and Different sensors. It also explain you the different pins available in the Arduino Uno.
My Twitter Account :
https://twitter.com/rakesh_prof
 
Click on the below link to watch the video on YouTube
 
 
 

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;  
}



Monday, September 5, 2016

How to create a google forms using Gmail

Google Forms

Google forms is very important and widely used feature of google. If you have a gmail account then
you can easily make your own google form for the following things:
1. For collecting the data.
2. No other one can modify the collected data.
3. for survey.

Now we see how can we make the google form:

Step 1: First login the gmail account.
Step 2: Click on the right upper side google apps menu(9 dots on the screen)




Step 3. : Select the Drive opting from the menu



Step 4: Select the New--> More->Google Forms

Step 5: The google Form will now display on the screen like this :



In the above google form there are two tab one for questions and another for responses. In questions
you can add as many as questions with as many as options. The type of questions you can add are:

1. Short Answer
2. Paragraph
3. Multiple Choice Questions
4. Checkboxes
5. Drop Down
6.Linear Scale
7. Multiple Choice Grid
8. Date and Time



Step 6.: You can also add questions, add title and description, add images, add video and add sections. The menus in sequence are:

Add questions means you can add more question in your google form.
Add title and Description means you can add your own title and their description in detail.
Add image can add any image which are related to you theme.
Add Video is used to add video which are related to your questionare.

Step 7. You can also store the responses by clicking on the response tab and add the excel file name where you want to store the responses.



.


Different variation of #define

1.
#include<stdio.h>
#define SQUARE(t) t*tvoid main()
{
      int n=8, Res;
     Res = 64/SQUARE(t);
     printf("%d",Res);
}
Result will be 64 . why?
because the statement Res=64/SQUARE(t); will be converted to  Res=64/8*8;
Res=64/8*8
     = 8*8=64.
Hence the preprocessor #define only substitute the statement not calculation.
Then what can I do , If I want to result as 1. The program should be
#include<stdio.h>
#define SQUARE(t) (t*t)void main()
{
      int n=8, Res;
     Res = 64/SQUARE(t);
     printf("%d",Res);
}
Now the result will be
Res=64/(8*8)
      =64/64 = 1
Again if program will be
#include<stdio.h>
#define SQUARE(t) (t*t)
void main()
{
      int n=8, Res;
     Res = 81/SQUARE(t+1);
     printf("%d",Res);
}
What will be the result, if you are thing about 1 then it is not right , But why? Now see
Res=81/SQUARE(t+1)
     = 81/(8+1*8+1)
     =81/(8+8+1)
     =81/17
      =4.76
=  4 (Because integer will display only integer part)
then what are the solutions? The solution will be
#include<stdio.h>
#define SQUARE(t) ((t)*(t))void main()
{
      int n=8, Res;
     Res = 81/SQUARE(t+1);
     printf("%d",Res);
}
2. Now guess what will be the result of
#include<stdio.h>
#define CUBE(t) t*t*t
void main()
{
      int n=5, Res;
     Res = 125/CUBE(t);
     printf("%d",Res);
}
???????????????????/
Your queries are always welcome.
3.
#include<stdio.h>
#define print(Num) printf("%d",Num);
int main()
{
    int Number=10;
    print(Number);
    return 1;
 }
It will display 10 , So Now you can print integer variable by own print command
4.


Sunday, August 28, 2016

Logical Components of an Android Mobile Application Development

Logical Components of an Android Mobile Application Development

 When you want to create a dynamic application then you have to require some important logical components of an Android application. There are four logical component of the Android Mobile Application Development:
1. Activity: Activity is one of the key logical component of the Android Mobile Application Development. It is the basis of User Interface of the app and makes the foundation of User Interface. User Interface contains visual elements , layout elements , resources and many more things.
Programmed component of the Used Interface which is programmed using java is an Activity and event handling. For example : Music is playing in background and in front you are using the browser.

2. Service: Service is another key component of an Android application. It always runs in the background and does not have a user interface. But UI is associated with it to interact with the service. In the music player, user need the UI to shuffle the songs or select the songs but for listening it not required to be in front of the mobile. User may use another app while listening the songs.

3. Broadcast Receiver: While you are using the mobile, there may be lots of announcement in your mobile related to low battery, download complete, incoming call, incoming SMS, availability of WI-FI Spot are initialed by the system. Some announcements are initiated by the app itself to let the other app understand. For Example: After completion of the download and is available of used.

4. Content Provider:  The data or content of the mobile app and is accessible across apps is the important aspect of mobile app development. However , due to security, any app required permission to access other app data . These data sharing after taking permission is done by using content provider. For example: for call a person whose detail is already saved in the contacts app, then contact app work as a content provider for calling , email and message app.
 

Video for the concept of Array and pointers

Example Program of Array and Pointers (Video)

https://www.youtube.com/watch?v=lT5D08ofRBQ

Some Important conceptual output based questions of Arrays and Pointers in C lnaguage

Some Important conceptual output based questions of Arrays and Pointers in C language 

1. 
void main()
{
   int Blog[]={1,2,3};
   printf("%d %d %d",Blog[1],Blog[2],Blog[3]);
}

Output: 2 3 0

Explanation: Here Blog[0],Blog[1] and Blog[2] will be initialized with 1,2 and 3 respectively. and rest are initialized with 0.

2.
void main()
{
   int Blog[]={33,44};
   printf("%x",Blog);
 }

Output: Base address of Blog

Explanation: The array name always holds the base address of an array. If we print *Blog then output will be the first value.

3.void main()
{
  int Blog[4]={22,33,44,55},*ptr,T;
  ptr=Blog;
  T=++(*ptr);
  printf("%d %d",*ptr,T);
 }

Ans: 23 23

Exlanation: *ptr points to the first element of an array Blog. After ++(*ptr) , the value 
of first element is increased by 1 that is 23 and also updated to the array. Hence the output will be 23 23.

4.
void main()
{
  int Blog[4]={22,33,44,55},*ptr,T;
  ptr=Blog;
  T=*(ptr++);
  printf("%d %d",*ptr,T);
 }

Ans: 33 22

Explanation: *ptr points to the first element of an array Blog. After *(ptr++), the pointer ptr points to next element that is second element of array but due to post increment the variable T contains the first element of an array Blog.

Thursday, August 25, 2016

Basic Guidelines of Value Education

Basic Guidelines of Value Education

The must be some basic guidelines for the value education because in most of the cases we are giving the value education without the guidelines. According to R R Gaur, R Sangal and G P Bagaria, the basic guidelines of value education are:
1. Universal: The value education needs to be applicable to all the human beings irrespective of casts, race, country, states , religion etc. for all time time and regions.
2. Rational: It has to appeal to human reasoning. 
3. Natural and Verifiable : The behavior should be naturally acceptable to the human beings and there needs to be every provision in nature for its fulfillment. And also needs to be experimentally verifiable not depends on beliefs or assumption.
4. All encompassing : It needs to cover all the dimensions (thought , work, behavior etc) and the levels of living like self, family, society and space of human life and profession.
5. Leading to harmony : The ultimate goal of the value education is harmony with all the level of living and nature.
 

Right Understanding + Relationship = Mutual Happiness

Right Understanding + Physical Facility = Mutual Prosperity

Nine values of Human

1. Trust
2. Respect (Respect is the right evaluation of the human being)
3. Affection
4. Care
5. Guidance
6. Reverence
7. Glory
8. Gratitude
9. Love ( Love is the combination of all above values)





Tuesday, August 23, 2016

Variable Declaration and Datatype in C language with their uses

Variable Declaration

The memory area used for storing the input data or intermediate data , is called variable.
There are some rules to declare the variables in C language:
1. Must be start with alphabet.
2. Special character is not allowed except _(Underscore).
3. Variable may be alphanumeric.
4. Variable name must be different from keywords used in C language like printf, scanf,eof etc.

The syntax for variable declaration is 
1. <datatype><space> <variablename>
2. <datatype><space> <variablename>=<value>

for example: int x;
int Num=10;
char str;
char str[45];

Datatype used in C language

A datatype is used to instruct the compiler that what type of data will be stored in variable. Different type of datatype are used in C language is:
1. int(2 to 4 byte)
2. float(4 Byte)
3. cha(1 byte)
4. double(8 byte)
5. long(4 Byte)

int and long datatype is used to store the integer , float and double are used to store the real values and char is used to store the character values.

Example:
int a,b;
char ch;
float Num;


Monday, August 22, 2016

Pattern Design in C language

Pattern Design in C language (Video)

Pattern Design in C Language

Write a program to draw the following pattern:

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

void main()
{
     int i,j;
     for(i=1;i<=5;i++)
     {
           for(j=1;j<=i;j++)
                printf("*");
       printf("/n");
      }
}


Sunday, August 21, 2016

Tips for Technical Interview in IT industry

Tips for Technical Interview in IT industry

  1. Prepare for a short introduction including the technical project which are genuinely done by you.
  2. Go through the website of company and get the information about company. for example: the company work for which domain primarily etc.
  3. Ask to seniors if any already working in the company about the technologies used by the company.
  4. Prepare yourself for the fundamentals of programming and algorithms because programming is the backbone of IT company.
  5. Prepare yourself comfortable upto average level(Concepts of classes,functions,datatypes,looping,conditional statement) for any one programming languages or tool.
post your query related to technical interview.

String in Java

Strings in Java

1. int n;
char chr;
String st1=”Rakesh Roshan”;
n=st1.indexOf(‘e’);
chr=st1.charAt(5);

what will be the value of n and chr?

2. int n;
String str1=”Rakesh”;
String str2=”Roshan”;
n=str1.compareTo(st2);

what will be the value of n ?

Different way to access array elements

Do you know there are many ways to access the elements of array.
int Num[10];
for(int i=0;i<10;i++)
    printf("%d%d%d%d",Num[i],i[Num],*(Num+i),*(i+Num));
Here all the format will give the same result that is every element of Array.

Saturday, August 20, 2016

Malloc and Calloc

Difference between Malloc() and Calloc()
1. malloc() takes one argument while calloc() takes two argument
2. malloc() does not initialize the allocated memory while calloc allocated memory intialized with 0.
3. Both are used for dynamic memory allocation.
4. malloc is faster than calloc
5.Example: int *p=(int *)malloc(sizeof(int));
                   int *p=(int *)calloc(10,sizeof(int));

Now blog is open to all for your valuable comment and suggestion, so that I can improve the blogs in future. You can also ask the questions related to my topics , I will try to answer your questions within 24 hours.
What will be the output of -1<<4 in C language?
Ans: The binary equivalent of -1 in 2 Byte is 1111 1111 1111 1111.
So after 4 left shift the result will be 1111 1111 1111 0000.
Hence the output will be fff0  in Hexadecimal format.

This question is very common for the placement exams of various company.

Android Mobile Application Development

Android Mobile Application development is very easy. Mobile Application Development can be done by any body who have a basic programming knowledge of Java, XML, HTML. The tools required to develop a Mobile Application are:
1. Eclipse or Android Studio
2. Android SDK
3. jdk 1.7 and above

In next post I will give you step by step procedure to develop first mobile application.

Preprocessor

Preprocessor is just the tools for text substitution. Preprocessor instructs the C compiler to do some work or processing which is to be done before compilation. Preprocessor is always start with #.Type of preprocessor are:
1. File Inclusion : #include
2. Macros: #define, #undef
3. Conditional : #if, #ifdef, #ifndef,#else, #elif,#error,#pragma,#endif