Posts

Showing posts from 2020

Program to decide whether a given number is positive, negative or zero number.

Image
Here, user will input a number and program will assign it in variable 'a' using scanf. After that, the value inside variable is checked, whether it is greater than 0 or not and if it is greater than 0 then inputted number is positive and if it is less than 0, the inputted number is negative. But if these two condition is not satisfied then the inputted number must be equal to 0.  Output  

When you use structure and union in C ?

Structure is a user defined data type which hold or store homogeneous data item or element in a single variable. It is a Combination of primitive and derived data type. In C language , array is also a user defined data type but array hold or store only similar type of data, If we want to store different type of data, then we need to define separate variable for each type of data. For this problem, Structure is best suit.   A union is quite similar to the structures in C. It also stores different data types in the same memory location. It is also a user defined data type same like structure. It is more near to structure. Union can be defined in same manner as structures, for defining union, use union keyword where as for defining structure, use struct keyword.  When you need to manipulate the data for all member variables then use structure. When need to manipulate only on member then use union. All the properties of the structure are same for union, except initialization proce...

Why Android Studio ?

Image
A ndroid Studioo is the official IDE for Android development, and with a single download includes everything you need to begin developing Android Apps.  The reason why we should prefer Android Studio are : -Flexible Gradle based build system. -Build variants and multiple apk file generation. -Code templates to help you build common app features. -Built in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine. -Rich layout editor with support for drag and drop theme editing. -Hint tools to catch performance, usability , version compatibility, and other problem. -Official Google Support and usual updates that need no migration.

Android Versions and Android SDK Manager

 Google, releases almost every year (or even sooner than a year), a new Android version in order to update the mobile operating system, so that it contains new features and possibilities and of course to fix things that might not work in the right way.  So, each version of Android has it's own SDK (software development kit), so that we can use to build apps that can run on and include all the latest features Android has added in its latest versions. This means that it is essential that we keep up updating our applications with the latest features all the time, and it possible, without losing the consistency of the previous Android versions.  As part of the Setup Wizard you will already have the latest SDK available to you, however it's useful to know how to install additional SDK's if you need to work with the older devices that do not run the latest version of Android.    SDK's allow you to create AVD's (Android Virtual Device) to test your apps on, customized ...

Positive Impact computers

 - Any professional individual like doctors, engineers, businessman etc undergo a change in their style or working pattern after they get the knowledge of computer. ' - An individual becomes more competent to take a decision due to computer because all the information required to take the decision is provided by the computer on time. As a result, any individuals or institutions get success very fast . - The person working at the managerial level becomes less dependent in low level staff like clerks and accountants . Their accessibility to the information increases tremendously. This improves their working pattern and efficiency, which benefits the organization and ultimately affects the society positively. - In common life also, an individual gets benefited with computer technology. When airports, hospitals, banks, departmental stores have been computerized, people get quick service due to the computer system. - Computers have created new fields of employment. These employments are...

Monitors

 The monitor is the most frequently used soft copy output device. A computer screen, that is, monitor, is a TV like display unite attached to the computer on which the output can be displayed and viewed. Images on the monitor are created by the collection of dots. These dots are known as pictures' elements or pixels. More the pixels on the monitor, sharper the picture is. The computer screen can be either a monochrome display or a color display. A monochrome screen uses only one color to display text on a contrasting background. A color screen commonly displays 256 colors. Nowadays, users are increasingly viewing video clips, animated objects, and complex graphics. Due to this, Monitors are becoming more popular. Monitors are available in various screen sizes like 14, 15,17,19,21 inches. Notebook- computer screen sizes are usually smaller, typically ranging from 12-15 inches. Most of the monitors are made up of CRT (Cathode Ray Tube) in which the image is formed, whose pixels are c...

C program to check whether inputted number is prime number or not.

Image
P rime numbers are divisible only by 1 and by themselves. 2,3,5,7,11 etc are prime numbers. These numbers are only divisible by 1 and by themselves. To check whether a given number is prime number or not, at first, we start a loop from 1 to given number and check as if it is divisible the loop incremented number and if it is, then we will print that given number is prime number and also if it is 2, we will directly check it and print that given number is prime number. Have a look here, The Output

C program to display prime numbers between 1 to 100.

Image
 P rime Numbers are those which have only 2 factors; by 1 and by themselves own. For examples, the first five prime numbers are 2,3,5,7 and 11. These numbers are divisible by 1 and by themselves. Here, we have to print prime numbers from 1 to 100. So, we have to use for loop. The nested for loop works here, one by variable 'a' and another by 'b' and an increment number is also stored in 'p'. The first loop starts from 1 and inside it, another loop begins until the value of b becomes greater then a. If the remainder when a is divided by b becomes 0. The value of p incremented by 1. If the value is 2 means that first loop also has moved for 2 and value of a is 2. And, so it get printed. The first prime number is extracted and now whenever the divisible of a by b becomes 0, the value inside a gets printed and we will get all the prime numbers.    The Output

Bug Bounty

Image
 F inding security vulnerabilities in some of the most important software or website and give a warning message to the owner is known as Bug Bounty. A bug bounty program is conducted by different reputed website owner to reward to those who report bugs in their product, specially to those who pertaining to security exploits and vulnerabilities.  To became a Bug bounty, Don't jump directly to hacking. You should have deep knowledge in the following topics: 1. Computer Fundamentals          You should know every things about computer fundamentals, how it works, all about input, processing, controlling, output, memory, bus system etc. A complete knowledge on computer architecture leads you towards a step forward in becoming Bug Bounty. 2. Internet(HTTP)               You should have deep knowledge about protocols. There is a way how the data in the Internet flows. What rules it flows and how the sender and...

Microwave System

  M icrowave system use very high frequency radio signals to transmit data through space (wireless communication). Transmitter and receiver of a microwave system mounted on very high towers, and should be travel almost straight line (should be line of sight). This may not be possible for very long distance transmission . Moreover, signal become weaker after traveling certain distance and require power amplification. Microwave system uses repeater at interval of about 25 to 30 km in between transmitting and receiving station. It is placed on tall building to avoid obstacles. It can support 250,000 voice channels simultaneously. It's installation charge is high. It is of two types : i) Terrestrial Microwave : A Ground stations that receives microwave signal, amplifies them and pass them on to another station are known as terrestrial microwave station. The distance between stations is between 25 to 30 miles. Parabolic antennas are used to transmit and receive to each other.  ii...

Simple Mail Transfer Protocol (SMTP)

 S imple Mail Transfer Protocol (SMTP) is the standard protocol for email services on a TCP/IP network. SMTP provides the ability to send and receive email message. SMTP is an application layer protocol that enables the transmission and delivery of email over the internet. SMTP is created and maintained by the Internet Engineering Task Force (IETF). Simple Mail Transfer Protocol is also known as RFC 821 and RFC 2821. SMTP is one of the most common and popular protocols for email communication over the Internet and it provides intermediary network services between the remote email provider or organizational email server and the local user accessing it.  SMTP is generally integrated within an email client application and is composed of four key components : 1. Local user of client end utility known as the mail user agent (MUA). 2. Server known as mail submission agent (MSA). 3. Mail Transfer Agent (MTA). 4. Mail Delivery Agent (MDA).     SMTP works by initiating a...

Android

 A ndroid is  a mobile operating system currently developed by Google, based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. Android offers unified approach application development for mobile devices. Android is an open source operating system. Google has made the code for the low-level "stuff" as well as the needed middleware to power and use an electronic device, and gave Android freely to anyone who wants to write code and build the operating system from it. There is  even a full application framework included, so third party apps can be built and installed, then made available for the user to run as they like.

Android Programming

Lots of people, are now engaged in developing android mobile application because of the reason that android has become most popular mobile operating system, with almost 2 billion devices activated. Developers are more interested to show there invention to the world and its the easy to reach more people through android mobile application development ,as almost, all the people are using devices that embed Android Operating system. Application developed for android operating system can run on Android powered TV sets or Android Car system and this is the reason, Application developed for android operating system has endless boundaries.   In this series of course, we will be able to be familiar with Android IDE and can be able to make an android app and we can place ads in our app and so we can earn more and more money though it.  Just follow the series and make comment so that, I can solve your problem.

Function In C

A function is a group of statements that together perform a specific task. Function is a block or part of program. A function definition specgifies the name of the function, the types and number of parameters, it expects to receive, and its return type, when any program is very long or same code is repeating many times then we try to cut the program in different parts(blocks) so that whole program become more understandable, easier to debug and size of code will be shorter. A repeated group of instruction in a program can be organized as a function. Every C program has at least one function, which is known as main() function. Why to use function? Functions are used for driving a large code into module, due to this we can easily debug andd maintain code. For example if we write a calculator programs at that time we can write every logic in a separate function(for example sum(), for subtraction sub()). Any function can be called many times. Advantages of Function Code Re-usabi...

An Array in C programming

A n array is a collection of similar data type which is stored in a consecutive memory location in a single variable. It is derived data type in C, which is constructed from the fundamental data type of C language. The individual values in an array are called elements. If it contains int data type then all the data of the array must be int, if float then all the data must be a float. Each array element is referred by specifying the array name followed by one or more subscript with each subscript enclosed in square brackets. In C subscript starts at zero rather than one and each subscript must be expressed as a non-negative integer. The subscript is used to denote the size of the array. . Advantages of array Code Optimization: Less code is required, one variable can store numbers of value. Easy to traverse data: By using array easily retrieve the data of array. Easy to sort data: Easily sort data using the swapping technique. Random Access: With the help of an array index you ...

Program To Print Multiplication table of 2, 3 and 4

Image
T o print the multiplication table we have to use for loop. Inner loop is used here where two varriable are plays vital role i.e. i and j. Symbolic letter "x" and "=" are also being used to give illusion of multiplication. So, the program begins here This program takes two varriable i andd j and are multiplied in the inner loop. In a first loop the value of i remains same while the value of j increases by 1. Integer specifier are used. Here new line is printed as the loop of j ended the new line begins. Output Here, all the multiplication table is not shown because the output window is small.

Program to print 2 3 4 5 6, 4 5 6 7 , 6 7 8 , 8 9 , 10 [Nested for loop]

Image
Output Explanation Here, nested for loops is used. The varriable  i initialize from 1 and then passes through next loop j and it gets continue to execute the statement that is inside the j block until the condition of j loop gets false. In the first loop of j, the value of i is 1 which is equal to the initialization of j and prints  the addition of  i and j  i.e  2.  Next time, the value of j increase to 2 but the value of i remains same as 1 and prints the addition of i and j i.e, 3  and  at last loop of j the value of j reaches to 5 but still the value of i is 1 and prints the addition of i and j,  i.e, 6.  When the condition gets false,  steps goes outside the loop and it meets the statement that prints next line.  Since,  the  condition of   loop   of  first loop of i is not false, the loops  begins  agai.  This  time the value of i is 2 and passes inside th...

Program to print odd numbers less than 20 using for loop.

Image
Explanation, Here, i is initialized with value and in every loop, value in i increase by 2 until the condition gets false. Output Exercise: Print even number less than 30 using for loop.

Program to print multiplication table of given number

Image
Explanation In this program, n stores a number and i is an increment. The loop start from 1 and ends on 10. Inside printf, the format %dx%d=%d, here %d are replaced by the value of n which is constant, i that is incremented in every loop and n*i which yields product of n and i. Here, x remain same till the program that makes a multiple sense in the output.

Program to print sum of first ten natural numbers

Image
Explanation Here the variable s denotes to sum and is initialized with value 0. When the loop begins, the s adds the value of i with its previous values along with the loop.When the loop terminate, the last sum is stored in s and is printed outside of the loop. Output

Program to print 'n' numbers using for loop

Image
Explanation Here, in the program, two variables are used n and i . n stores number inputted by user and "i" is used as loop. As the loop increment it will print the value of i until it becomes greater than number stored in n . Output Exercise Make a program that will print "*" for n times using for loop.

Program to print first 9 natural numbers using For loop

Image
Here, I have used Dev C++ platform, it is easy to download. In this program, integer "i" is declared. For Loop has been used initiating i from 1 and print the value of i in each loop increasing value of i by 1 until given condition becomes false ie, i<10. Output Exercise Print natural numbers from 10 to 30 using For Loop. Give your answer in comment section.

Goto Statement or Jump statement in C

Image
T he goto statement is also known as jump statement that makes a program procedure to jump any where from anywhere within the program. It is sometime also called unconditional jump statement.  In this program, it takes name of a person and then prints it. Here " jump: " is a label that goto statement will transfer the step when encountered. So, after printing the name, it asks to continue and if a user enter y or Y the goto statement transfer the step to that label and if any other key is pressed the program will print Visit Again.

Break and Continue in C

Image
B reak statement when encountered in the loop it immediately break the loop and program resumes at the line following the loop. It also terminate the case statement in switch. For example, if we are writing a program to search a name among 1000 of given names, we may have applied loop for this program, . But if the program finds it in 10th iteration and at this point, we don't need to travel for remaining 990 iteration, we just need to terminate the loop and resume the program outside the loop. For this, only break statement is useful.The break statement is used in conjunction with condition. For example, In this program, i increases by 1 and when it encounters with number 5, it gets broken and the loop gets terminated.And thus, the output will be 1 2 3 4 C ontinue statement is used to omit a particular statement and proceed to next iteration. The continue statement escape the statement and move to next iteration. For example, if we have to escape 10th number from 1000...

Looping

Image
L oop is used in programming to execute any instruction repeatedly until a condition is satisfied. The computer has ability to perform a set of instructions repeatedly. This involves repetition of some portion of a program either for a specified number of times or till a given condition is satisfied. This repetition operation is known as looping. Purpose of Looping To execute statements for a specified number of times. To use a sequence of values. Types of Loop in C programming While Loop do while Loop For loop While Loop It execute one or more statements while the given condition remains true. It is useful when number of iterations is unknown. It is also called entry control or pre test loop. fig: Flowchart of while loop do while Loop do while loops are useful where loop is to be executed at least once. In do while loop condition comes after the body of loop. The loop executes one or more statements while the given condition is true. It is an exit control or post...

Social Medias on Corona Virus

Image
Nowadays, social medias such as Facebook, Twitter, Instagram are full of information related to Corona virus. Almost everyone in the world are using these medias and getting information related on this viral topic. But, mean while since the information are shared by anyone may create confusion on the information related Corona virus since a false news are also been posted there. Social medias are need to be consider for this and should make a necessary steps to filter the information on the serious sensitive information. People are becoming panic and are afraid very much since they are getting wrong information. They are in dilemma of either their locality has become prey of the virus or not, either the vaccine are made yet or not, either they are safe to travel to foreign or not, either the precaution they are using is better or not and so on. A large masses of people are sharing the wrong information day by day in Facebook. Many more TV channels are making it as source of inc...

Program to print name of a day using switch case statement.

Image
  Explanation: Here number is inputted in variable 'day' and when it is equivalent with day in week and matches the preceeding case, it will print whatever in the block given.  

Why we use function in C?

F unctions are used for dividing a large code into module, due to this we can easily debug and maintain the code. For example if we write a calculator programs at that time we can write every logic in a separate function. Any function can be called many times. A dvantages of Function Code Reusuability Develop an application in module format Easy to debug the program Code optimization: no need to write a lot of code Code is easier to read Program testing becomes easier Compiled executable is smaller You don't need to make comments because function name make sense Program can be developed in short period of time There is no chance of code duplication

Program to check whether a entered letter is vowel or not using switch case statement

Image
Explanation Here Switch case plays a role of nested if else statement. It is an alternative way of if else statement. In this program, a variable c is declared to store alphabet entered by user. And now case is applied, if the given letter matches to the case then it enters to its block and print the given statement and then break the procedure. If the case is not matched it will check another case and if not matches all the cases then it will enter to in the default block. Output

Program to print division of a person.[Note: A person gets Distinction if s/he score 80% or above, First Division if s/he below 80% and above 60% , similarly 50% or above will be Second and if 32% and above will be Third division]

Image
E xplanation Here, per stores float percentage. It has been checked and if it is above 100 or below 31 it will print invalid that is stated in else statement at line 16. Nested if statement is used here so if the "per" value is  less or equal to 100 and if per is above 31 it enters inside and is checked with value 80,60,50 to print distinction, first and second division respectively and for third division,it will be sure if the above condition is false.

Program to find greatest number among any three different numbers inputted by User.

Image
  Explanation :Here three variables are declared a,b and c. The numbers in a,b and c are checked considering a is the greatest it is compared with b and c. If is greater in both condition, it will be greatest and if not, surely b or c will be greatest and are compared using else if. If b is greater than c then b will be greatest number and if it is also not then c is the greatest number as neither a nor b is greatest. Output Exercise : Make a program to state the smallest number among any three different inputted numbers.

Progarm to state that a person can cast vote or not. [Note: A person can cast vote if he is 18 years old or above]

Image
  Explanation, Here name is string so as it is defined as character of array 50. The specifier is %s is used to take scanf and value in age is checked with 18 and if it is equal to 18 or greater than this s/he can cast vote and if it is less than 18 and s/he cannot vote.   Exercise:  Make a program that can say he is old or yound. [Note if s/he is greater than age 40 than he is old and if he less than 40 then he is young.]