Programming Shortcut

Write, Run and execute Your programs with simple and esay way by Programming Shortcut

Showing posts with label Programs in c. Show all posts
Showing posts with label Programs in c. Show all posts

Monday, July 29, 2019

Function Oriented Programming and Object-Oriented Programming


What is the difference between in the Function Oriented Programming and then Object-Oriented Programming :

In the Function Oriented Programming and then Object-Oriented Programming and obviously, there are many good points and bad points of both programmings,
I have listed a brief summary of the different facilities that the Functionality Programming and then Object Oriented Programming provide us.


Function Oriented Programming:-


Programming Organization: Program is divided into small parts called functions.
Importance: Importance is not given to data but to functions.
Approach: Function Oriented Programming follows a top-down approach.
Access Specifiers: Function Oriented Programming dose not any access specifier.
Data Moving: Data can move freely from function to function in the system.
Maintainability: To add new data and function is not easy.
Data Access: function uses global data for sharing that can be accessed freely from function to function freely in the system.
Data Hiding: No data hiding is possible, hence security is not possible.
Overloading: Polymorphism is not possible.
Examples: C, Visual Basic, FORTRAN, Pascal.
 

Object-Oriented Programming:- 

Programming Organization: Program is divided into parts called objects.
Importance: Importance is given to the data rather than procedures.
Approach: Object-oriented programming follows a bottom-up approach.
Access Specifiers: Has three access specifiers, namely:- Public, Private, Protected.
Data Moving: Object can move and communicate with each other.
Maintainability: Provides an easy way to add new data and function.
Data Access: Object uses local data and can be accessed in a controlled manner.
Data Hiding: Provides data hiding, hence secured programming is possible.
Overloading: Ploymarphism is possible.
Exmaples: C++, JAVA, VB.NET, C#.NET.

More Code »

Wednesday, April 17, 2019

How to start learning first programming language

Introduction

When we start to learn your first programming language, we have many questions like how to start your first programming language and what we need to start your programming language and what language is better to start. Programming is a very useful and rewarding hobby. There are few better feelings than when someone sees you using a program you lashed together to make your life easier and says that it looks really useful. Most people have, at some point in their lives, really wanted to be able to do something on their computer or phone and been unable to. If you know a programming language, then there is often a fair chance that you can write a program to accomplish that task yourself. While there are a huge number of programming languages, many of them have a lot of similarities; this means that once you learn one language quite well, in most cases you will be able to pick up a new one far quicker.

Selecting Your First Language

Now that we have examined the limitations and handled some of the more unrealistic expectations, those of you still wanting to learn to code will be happy to know that programming is not a hard thing to start learning and will not require you to pay out huge sums of money. If you are reading this article online, you already have the resources to start with some languages, so let us consider what your first language ought to be.

Traditionally the first language a programming newcomer learns is either Visual Basic or Python. The first thing to understand is that these two languages are very different. The simplest difference is one of price. Python is totally free; you can start writing python now with just a text editor on your computer, though if you are on Windows, you will probably need to install it first. However, Visual Basic, often abbreviated to VB, is both free and not free. On the upside, VB can be simpler for newcomers to learn because it allows you to build the interfaces (the part of the program the user will see) by dragging and dropping the different parts much like designing it in some basic art application. The version of VB newcomers learn is usually Visual Basic 6, but this is rather outdated and has been discontinued. So these days the version learned is often VB.NET which can be considerably less simple for newcomers.

VB.NET must be developed inside what we call an IDE (Integrated Development Environment); this is basically a special program you use to write other programs. They also exist for Python, but their use is totally optional. The free VB.NET IDE is called Visual Studio Express. At the time of writing, the latest version is Visual Studio Express 2010. Unfortunately, by using the free version of the IDE you are restricted with what you can do, and any programs you create cannot be commercially sold on. Regretfully, the full paid version of the IDE is not cheap, and probably not appropriate for a hobbyist, but fortunately, to learn VB the free version is enough. In practice, very few commercial programs are developed in VB these days, but the Visual Studio IDE allows you to use many other languages. The familiarity you will develop by using it will also allow you to use the power of the IDE for development in many other languages. Some will argue that almost every language can be developed in a text editor and that they are by far the most flexible way in which to code. While this is technically true (and I do suggest trying development in a text editor to compare once you get a little better), I would strongly advise learning your first language with a proper IDE.

While traditionally, people learn Python or VB first and these are generally what is taught at schools, I would not suggest either of these. I am of the opinion that your first language should continue to be useful to you one it has served the purpose of helping you learn the fundamentals of programming. If I had to recommend one of these for newcomers, it would be VB.NET as often the most complex part of programming is the graphical side of things and in VB.NET this is very simple due to the drag and drop interface. These two languages are often used as introductions as they are very tolerant of mistakes, and allow you to become confident in programming principles without worrying about a lot of the more complex matters.

For those brave souls among you, I would actually suggest Java as your first language, even though it can be complex, and is therefore not a common choice for a first language. Java programs are different from most others in that they do not run on your computer. The user downloads Java, then your code runs on what is called a VM (Virtual Machine). This means that your code runs in a special place Java sets up for it - a fake copy of your computer - and handles the translation of this to the real machine for you. This means that Java programs are "cross-platform", meaning that they will, for the most part, run on Windows, Mac, Linux, and most other operating systems.

Java is a good language to learn, as it is very widespread and useful. Furthermore, it is very powerful and is available for free for both hobbyists and commercial uses. However, in contrast to VB and Python, it does not tolerate mistakes and requires you to be very specific about everything. It is also an object-oriented programming language, which is a very complex issue which I will briefly try to summarise. Languages like Python and VB are what is known as procedural languages, meaning that the lines of code are run one after another, whereas Java is an object-oriented language. object-oriented development is a term thrown around a lot these days in the programming world, and while not always appropriate it is generally considered a good idea. At the most basic level, an object-oriented program is all about objects. An object is an "instantiation" of a "class". A class is a blueprint used to describe something like a cat. The class contains both the data about the cat such as its name, age and owner as well as "methods" which are essentially actions the cat can perform, such as miaow. An instance of the class "cat" would give you a particular cat. However, this is not a Java tutorial, so if you are brave enough to experiment with Java you will come across this yourself in more detail. It is worth noting that VB.NET and Python both have support for object-oriented development, and Java has the potential to be used procedurally, but these are not the languages' primary intended uses and are not often used. If you did not understand that comparison, don't worry about it too much. Object orientation is hard to get your head around, but any basic Java or another object-oriented language tutorial will have you understanding everything in that paragraph.

A final reason Java is a good first language is that it is similar in many ways to Javascript, which is an entirely different class of language. Javascript is a scripting language (as is Python), and learning Java will mean you understand Javascript reasonably well. The difference is between scripting languages and normal programming languages are outside the scope of this article, but as large generalization scripts are generally used for automated tasks while programs are used interactively by users. This is not totally true, as both types of language are used for both tasks and most web programs are built in Javascript.

As for the actual language you pick, it is entirely up to you. Some may choose the traditional beginner languages or be brave and experiment with Java. Some of you may already have your eye on a language or fancy one of the more specialist languages like Scheme or Prolog. Whatever your choice, the way you will learn how to program is the same.


What IDEs ( Integrated Development Environment ) is best?

Many of the purists say that IDEs are a bad idea, and are packed with unnecessary tools and menus that take up disk space and time to learn. While this is true, I feel that an IDE is definitely worthwhile. Many people offer free IDEs, such as Eclipse and Netbeans, for the more popular languages. There is also Visual Studio, which I mentioned previously; it is very intuitive, very powerful and it supports many languages (much as Netbeans and Eclipse do). If you chose to use Java I would suggest Netbeans, as there is a packaged version of Netbeans with the JDK (Java Development Kit). Most languages need an SDK (Software Development Kit) to work with them, and getting it installed properly and linked to the IDE is often the hardest part of the procedure. Visual Studio already comes with the development kits set up, which makes life easier, but other languages like Java and Python can be quite hard to set up properly. This is why I suggested the Netbeans + JDK bundle for those experimenting with Java, as it handles the complex set up for you, which will save you hours of suffering.

There are, in my opinion, three major advantages to using a fully featured IDE. Firstly, they are usually extensible, meaning that there are many free plug-ins that could make your life a lot easier when you get a little more advanced. Secondly, and most importantly, is the ease with which an IDE allows you to debug your code. Most IDEs let you set breakpoints in the code, which will make the program stop when it gets to that point and let you step through it line by line so you can examine the contents of all the variables at any time. (For those of you who do not know what a variable is, I will briefly explain. A variable is a bit like a train station locker. You ask for one big enough to hold what you want to store, and if what you want to store is the right shape, it can be stored there. When you write a program, any data you want to store temporarily will be held in one of these until you are done with it.) As the old programming saying goes, if you have not found any bugs, you are not looking hard enough. Almost no non-trivial program will work the first time, and trying to work out where the problem lies without the use of a debugger is a pain I would not wish on anyone. Finally, an IDE will often give you advice on how to fix issues in the code. This can be very useful for fixing bugs and saves you having to resort to Google every other minute.

Learning Another Language

Once you have learned one language, whatever it may be, the most valuable thing you will have learned is all the keywords for searches. When you want to do something in a new language, you need only search for what you want to do and the language name. However, by now you will know the names used to refer to what you want to do, allowing your searches to be more effective and yield examples and answers much more quickly. As the fundamentals of programming are mostly the same, regardless of the language you use, you will hopefully be able to guess at the meaning of most of the code much more effectively once you locate an example, allowing you to pick up most of the language very quickly indeed.

Limits

One thing that all new programmers must come to term with is the amount of time learning a programming language takes. Although when you have become an expert you will be able to write many programs quickly, you must remember that many programs have taken whole teams of expert developers years to create. So it is important to understand that knowing a programming language or even several is not enough to write some of the more complex programs you have seen. Don't look upon this new hobby as a way to save yourself a lot of money, as writing your own version of most of the programs that you need to pay for now will be out of your reach.

The most important thing that a new programmer needs to know is that the "Learn Programming in 24 hours" sort of books is simply not true. A more accurate title would be "Learn Programming in 10,000 hours". If you put 24 hours or a week into learning a language you will not be creating the next Windows or a new, state of the art game. It is possible to learn to write a program in 10 minutes, and really all you need to learn a new language is your favorite search engine, but you will not be an expert. The only way to become an expert is much like learning the violin; the answer is practice, practice, and practices some more.

Practice makes a man perfect
More Code »

Monday, February 4, 2019

Program to find whether the alphabet is a vowel or consonant

Hello Friends! Welcome to programming shortcut
Today will discuss:
--> Program to find whether the alphabet is a vowel or consonant or
--> c program to check vowel or consonant using a switch or
--> program to check an alphabet is a vowel or consonant


#include
#include
void main()
{
char ch;
printf("Enter an alphabet : \n");
scanf("%c",&ch);
switch(ch)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
 case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
printf("Alphabet is a vowel\n");
break;
default:
printf("Alphabet is a consonant\n");
}
getch();
}


Output:

   First, run:
   Enter the alphabet :
   a
   Alphabet is a vowel

   Second Time run:
   Enter the alphabet :
   d
   Alphabet is a consonant

Explanation: In this programming, we use the Switch case to check an alphabet is a vowel or consonant


Hello, Friend We first write the program and compile them and run the program to check compiler error or run time error.
Please share the site and comment on your ideas and your suggestions. All suggestion was all welcome.
If any question or doubt in the programming please mention the comment.
Thank yours very much. 
More Code »

Sum of digits of a number until the sum is reduced to 1 digit in c

 Hello Friends!
 Today will discuss do while loop with the example, how to make a program in c by a do-while loop,   do while loop in c programming example with explanation and how to make c program to Sum of digits of a number until the sum is reduced to 1 digit. Nested Loop in c program
 Write a program in c to find the sum of digits of a number until the sum is reduced to 1 digit.
 For example: 
 The number is 538769.
 Then 5+3+8+7+6+9=38
          3+8=11
          11=2

Sum of digits of a number until the sum is reduced to 1 digit in c program

#include
int main(void)
{
long num,dig,sum;
printf("Enter a number : ");
scanf("%ld",&num);
printf("\n%ld",num);
do{
sum = 0;
while(num!=0)
{
dig=num%10;
sum+=dig;
num/=10;
}
printf("->%d",sum);
num=sum;
}while(num/10!=0);  /*while num is more than one digit*/
return 0;
}

Output: Enter The number 538769
              538769->38->11->2


Explanation :

      do{
/* 1: program code */
}while(num/10!=0);
The Above Condition is not exit while num. is more than one digit.
      
 /* 1: program code */
while(num!=0) 
{
dig=num%10;
sum+=dig;
num/=10;
}
Here we use program code to find a sum of digit then the given program example is for "Sum of digits of a number until the sum is reduced to 1 digit"

So we find Your Program what we want. 

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut

Please share your experience about this post,
Thank You!
More Code »

reverse a number in c program

Hello friends! welcome to my blog
Today will discuss the basic concept and simplest way to how to reverse a number in c by programming and how to make program for reverse of a number without array in c programming,

Write a program to reverse a number


#include
int main(void)
{
int n, r=0,d;
    clrscr();
    printf("Enter the number\n");
scanf("%d",&n);
printf("Number befour reverse= %d ",n);
while(n>0){
d= n%10;
r= r*10+d;
n=n/10;
}
printf("Number After reverse= %d", r);
return 0;
}


Output: Enter the Number
        1234
Number befour reverse= 1234
Number After reverse= 4321

Program to count no of digit to a number


#include
int main(void)
{
int n, c=0,d;
    clrscr();
    printf("Enter the number\n");
scanf("%d",&n);
while(n>0){
d= n%10;
n=n/10;
c++;
}
printf("The entered number has %d digits", c);
return 0;
}


Output: Enter the Number
       1234
   The entered number has 4 digits

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut

Please share your experience about this post,
Thank You!
More Code »

Switch case program in c with example

Hello friends! Welcome to my blog

Today we discuss How to use switch case conditional statement in c and how to program switch case in c programming examples

What is switch Case?

Switch case is a multi-way conditional statement. It Works like as if else if nested conditional statement.But the Advantage of using Switch case over if else if nested conditional statement Management of switch case is easy

See Switch case example below that how work switch statement:

Switch case in c programming example




    #include
    #include
    main()
    {
        char op;
        long  a,b;
        clrscr();
         printf("Enter two number to calculate: \n");
         scanf("%l\t%l",&a,&b);
         printf("Please chooese a operator +, -, *, /");
         scanf("%f",&op);
         switch(op)
         {
            case '+':
                  printf("%l + %l = %l",a,b,a+b);
                 break;
         case '-':
                 printf("%l - %l = %l",a,b,a-b);
                  break;
        case '*':
                printf("%l * %l = %l",a,b,a*b);
                 break;
         case '/':
printf("%l / %l = %l",a,b,a/b);
break;
default:
printf("Enter valid operator\n");
}
getch();
     }


Output: Enter two number to calculate:
             10  4
Please chooese a operator +, -, *, /
              +
10 + 4 =14
     

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut
Please any query email programmingshortcut@gmail.com

Please comment your experience on this post,
Thank You!

      
More Code »

how to swap two numbers without temp in c

Hello friends! Welcome to my website

Today we show you how to swap two numbers without temp or how to swap two numbers without using third variable in c and c program to swap two numbers and how to swap two numbers in c language programming.

How to swap two numbers without using third variable in c


#include
#include
void main(){
int a,b;
clrscr();
printf("Enter two numbers\n");
sacnf("%d",&a);
sacnf("%d",&b);
printf("Before swap:\n a=%d \n b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("After swap:\n a=%d \n b=%d",a,b);
getch();
}



  Output: Enter two numbers:
    4
   5
  Before swap:
   a=4
   b=5
  After swap:
   a=5
   b=4



C program to swap two numbers



#include
#include
void main(){
int a,b,temp;
clrscr();
printf("Enter two numbers\n");
sacnf("%d",&a);
sacnf("%d",&b);
printf("Before swap:\n a=%d \n b=%d",a,b);
temp=a;
b=a;
a=temp;
printf("After swap:\n a=%d \n b=%d",a,b);
getch();
}


  Output: Enter two numbers:
    4
   5
  Before swap:
   a=4
   b=5
  After swap:
   a=5
   b=4



I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut
Please any query email programmingshortcut@gmail.com

Please comment your experience on this post,
Thank You!
More Code »

fibonacci series programming c

Hello friends! Welcome to my website

Program to generate fibonacci series programming in c. How to use for loop in c language with example
In this fibonacci series each number is a sum of the previous two numbers. fibonacci series programming c, fibonacci series c programming, fibonacci series c code in c  session

How to print fibonacci series programming in c


#include
#include
void main()
{
long x,y,z;
int i,n;
x=0;
y=1;
printf("Enter the number of terms : ");
scanf("%d",&n);
printf("%ld ",y);
for(i=1; i {
z=x+y;
printf("%ld, ",z);
x=y;
y=z;
}
printf("\n");
getch();
}


Output: 
1, 1, 2, 3, 5, 8, 13, 34, 55, 89...................



I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut
Please any query email programmingshortcut@gmail.com

Please comment your experience on this post,
Thank You!

More Code »

Print 1 to n even and odd number in c

Hello friends! Welcome to my website

Today We Run a program to print 1 to n even numbers and odd number in c programming. Here I show you, how use of while loop in c programming with Example
This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.


Print 1 to n even numbers in c 


#include
#include
void main();{
    int n, i=0;
clrscr();
printf ("Enter a number to want to print odd no. list: ");
scanf("%d",&n);
printf("The Even Numbers list is:\n");
while(i if((i%2)==0){
printf("%d\t", n);
}
i++;
}
  getch();
 }


Output: Enter a number to want to print even no. list: 10
              The Even Numbers list is:
             0 2 4 6 8


Print 1 to n odd numbers  in c 


#include
#include
void main();{
    int n, i=0;
clrscr();
printf ("Enter a number to want to print odd no. list: ");
scanf("%d",&n);
printf("The odd Numbers list is:\n");
while(i if((i%2)==1){
printf("%d\t", n);
}
i++;
}
    getch();
}


Output: Enter a number to want to print odd no. list: 10
              The odd Numbers list is:
              1 3 5 7 9


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut
Please any query email programmingshortcut@gmail.com

Please comment your experience on this post,
Thank You!

More Code »

Check a number is even or odd number in c Programming

Hello friends! Welcome to my website

Today We Run a program to check a number is even number or an odd number in c.
This session is how to check a number is even or odd in c Programming. Here we show you, how use of For loop in c programming with Example
This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

How to Find even or odd number in c Programming?


#include
#include
void main();{
    int n;
clrscr();
  printf ("Enter the number to ckeck even or odd number: ");
  scanf("%d",&n);
       if((n%2)==0){
   printf("\n%d is a Even Number", n);
   }
   else{
   printf("\n%d is a Odd Number", n);
   }
 
  getch();
    }


Output: Enter the number to check even or odd number: 4
             4 is an Even number
             Enter the number to check even or odd number: 5
            5 is an Odd number



Note: This program is run 2-time output.


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut

Please share your experience about this post,
Thank You!

More Code »

How to print numbers 1 from 10 in c language

Hello friends! Welcome to my website

Today We Run a program to print 1 to 10 number in c language.
This session is how to print number 1 to 10 and 1 to 10 with the difference of 2 in c Programming. Here use of while loop in c programming with Example
This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

Program to print numbers 1 from 10 in c


#include
#include
void main()
{
int i=1;
//condtion to check till print number
while(i {
printf("%d",i);
//print to new tab
printf("\t")
    //Statement to incriment the number
i = i+1;
}
getch();
}


Output: 1 2 3 4  5 6 7 8 9 10

Program to print numbers 1 from 10 with difference of 2


#include
#include
void main()
{
int i=1;
//condtion to check till print number
while(i {
printf("%d",i);
printf("\t")  //print to new tab
    //Statement to incriment in order with difference of 2
i = i+2;
}
getch();
}


Output: 1 3 5 7 9


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut

Please share your experience about this post,
Thank You!
More Code »

Find the prime number in c Programming

Hello friends! Welcome to my website

Today We Run a program to check prime number in c.
This session is how to check the number is prime or not in c Programming. Here use of while loop in c programming with Example
This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

How to Find the prime number in c Programming?


#include
#include
void main();{
    int n, i, m = 0, f = 0;
clrscr();
  printf ("Enter the number to ckeck prime number");
  scanf("%d",&n);
        m = n / 2;
        if (n == 0 || n == 1) {
            printf("%d is not prime number", n);
        } else {
            for (i = 2; i                 if (n % i == 0) {
                    printf("%d is not prime number", n);
                    f = 1;
                    break;
                }
            }
            if (f == 0) {
                printf("%d is prime number", n);
            }
        }
     getch();
 }


Output: 3 is prime number
4 is not prime number
5 is prime number


Note: This program is run 3-time output.


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.
I am Try to Help in your Programming Language by Programming Shortcut

Please share your experience about this post,
Thank You!

More Code »

Area of a Rectangular Ground in c Programming

Hello friends! Welcome to my website

Today We Run a program to find Area of a Rectangular Ground in c.
This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

How to Find Area of a Rectangular Ground in c Programming?

#include
#include
void main(){
float l, w,result;
clrscr();

    printf("enter the value of length: ");
scanf("%f", &l);
printf("enter the value of width: ");
scanf("%f", &w);

result= l*w;

    printf("The area of the Rectangular Ground: %f" result);

getch();

}


Output: enter the value of length: 15
        enter the value of width: 10
The area of the Rectangular Ground:150 square unit;

Note: To find Curricular Ground Area, take the radius of the curricular ground as input and use a function as a single parameter and calculate:
      'result= (22/7)*r*r
      where r is the radius and 22/7 use as Pie Value

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.

Please share your experience about this post,
Thank You!

More Code »

Find grade of a student according to their percentage in c programming

Hello friends! Welcome to my website

Today we run C programming to find out the grade of a student when the marks of 6 subjects are given.
The method of assigning grade is -
percentage>=85 grade=A
percentage=70 grade=B
percentage=55 grade=C
percentage=40 grade=D
percentagegrade=E


This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

Find grade of a student according to their percentage in c programming

#include
#include
void main()
{
float m1,m2,m3,m4,m5,m6,total,per;
char grade, name;
printf("Please Enter the Student Name:");
scanf("%c",&name);
printf("Enter all subjects marks of %c: ",name);
scanf("\t%f\t%f\t%f\t%f\t%f\t%f",&m1,&m2,&m3,&m4,&m5,&m6);
printf("\n");
//Calculate the percentage of all Marks
total=m1+m2+m3+m4+m5+m6;
per=total/6;
//Condtion Check for to find the grade of
if(per>33){
if(per>=85){
grade='A';
}
else if(per>=70){
grade='B';
}
else if(per>=55){
grade='C';
}
else if(per>=40){
grade='D';
}
else {
grade='E';
}
printf("%c passed with %c Grade and %f\n",name,per,grade);
}
else{
printf("%c is Fail in the Examnation " name);
}
getch();
}


Output:
     Please Enter the Student Name: Abcd
     Enter all subjects marks of Abcd: 75
         74
45
89
100
99
     Abcd passed with B Grade and 80.33333333333333%


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.

Please share your experience about this post,
Thank You!

More Code »

Find a year is leap or not in c programming

Hello friends! Welcome to my website
C programming to find the year is a leap year or not that year entered by the user?
This C language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

Program to find a year is leap or not in the c programming
 
#include
#include
void main()
{
int year;
printf("Please Enter a year: ");
scanf("%d",&year);
 
if(year%100 != 0)
{
if(year%4 == 0){
printf("Year %d is a leap Year.\n", year);
}
else{
printf("Year %d is not leap Year.\n", year);
}
}
else
{
if(year%400 == 0){
printf("Year %d is a leap Year.\n", year);
}
else{
    printf("Year %d is not a leap Year.\n", year);
}
}
getch();
}


Output:
    Please Enter a year:2016
Year 2016 is a leap Year.

Please Enter a year:2014
Year 2014 is not a leap Year.



 Note: This programming output writen two time 

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this C programming code or input & output please comment below
If you have another question about C programming send an email by contacting us form are given on the page right side.

Please share your experience about this post,
Thank You!
More Code »

Biggest and smallest from three given numbers in c

Hello friends! Welcome to my website
C programming to find the biggest and the smallest number between two numbers?
This c language programming is free all type of errors like the compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code with the output. This programming output is customized to understand easily.

Program to find the biggest number from three given numbers in c

#include
#include
void main()
{
int a,b,c;
clrscr();
printf("Enter the frist number: ");
scanf("%d", &a);
printf("Enter the second number number: ");
scanf("%d",&b);
printf("Enter the thired number: ");
scanf("%d",&c);
//codtion to check biggest number
if(a>b&&a>c){
      printf("%d is biggest then %d and %d ." a, b, c);
}
//codtion to check biggest number
else if(b>a&&b>c){
  printf("%d is biggest then %d and %d .",b, a, c)
}
else{
printf("%d is biggest then %d and %d ."c, a, b);
}
getch();
}


Output:
Enter the first number: 8
Enter the second number: 10
Enter the third number: 7
10 is biggest then 8 and 7

Program to find the smallest number from three given numbers in c


#include
#include
void main()
{
int a,b,c;
clrscr();
printf("Enter the frist number: ");
scanf("%d", &a);
printf("Enter the second number number: ");
scanf("%d",&b);
printf("Enter the thired number: ");
scanf("%d",&c);
//codtion to check smallest number
if(a       printf("%d is smallest then %d and %d ." a, b, c);
}
//codtion to check smallest number
else if(b   printf("%d is smallest then %d and %d .",b, a, c)
}
else{
printf("%d is smallest then %d and %d ."c, a, b);
}
getch();
}


Output:
Enter the first number: 8
Enter the second number: 10
Enter the third number: 7
7 is smallest then 8 and 10


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have another question about c programming send an email by contacting us form are given on the page right side.

Please share your experience about this post,
Thank You!


More Code »

Bigger and smaller number in c programming

Hello friends! Welcome to my website
C programming to find the bigger and smaller number between two numbers?
This c language programming is free all type of errors like compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code only with their output.

 Program to print the bigger number between two numbers


//-------start code -----
     #include
     #include
     void main()
     {
           int a,b;
     clrscr();//to clear prv. out of output console
     // input numbers
     printf("Enter frist number: ");
     scanf("%d",&b);
     pirntf("\n");//to change the new line
     printf("Enter second numbers: ");
     scanf("%d",&b);
     pirntf("\n");//to change the new line
     // condtion to check bigger no.
     if(a>b){
     printf("%d is bigger number then %d\n",a,b);
     }
     else{
     printf("%d is bigger number then %d\n",b,a);
     }

     getch();
     }
//---- end code -----


     Output: Enter first number:8
                  Enter Second number:5
  8 is bigger number then 5


Program to print the smaller number between two numbers


//----- start code -----
     #include
     #include
     void main()
     {
     int a,b;
     clrscr();
     // input numbers
     printf("Enter frist number: ");
     scanf("%d",&b);
     pirntf("\n");//to change the new line
     printf("Enter second numbers: ");
     scanf("%d",&b);
     pirntf("\n");//to change the new line
     // condtion to check smaller no.
     if(a      printf("%d is smaller number then %d\n",a,b);
     }
     else{
     printf("%d is smaller number then %d\n",b,a);
     }
     getch();
     }
//---- end code -----


Output: Enter first number:8
             Enter Second number:5
     5 is smaller number than 8


Note: Output structure will same only change the result according to the input numbers by programmer


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any dought about this c programming code or input & output please comment below
If you have other question about c programming send an email by contacting us form are given on page right side.
Thank You!

More Code »

Relation of two numbers in c programming

Hello friends! Welcome to my website
C programming to find the two number how to related to each other is greater than or less than or equal?
This c language programming is free all type of errors like compiler and runtime errors and this programming is tested to compile and then run the program code.
Here is only programming code only with the there output.

Find the relation of two numbers c programming language.

//------- code start ------
       #include
       #include
         {
        int a,b ;
        //Input number
        printf("Enter frist number value: ");
        scanf("%d",&a);
            printf("\n");
        printf("Enter second number value: ");
        scanf("%d",&b);
        printf("\n");
        // compairtion and result output of the two number relation.
        if(a
             printf("%d is less than %d\n",a,b);
           }
        if(a           printf("%d is less than or equal to %d\n",a,b);
        }   
        if(a==b){
          printf("%d is equal to %d\n",a,b);
        }
        if(a!=b){
                printf("%d is not equal to %d\n",a,b);
        }
        if(a>b){
          printf("%d is greater than %d\n",a,b);
        }
        if(a>=b){
          printf("%d is greater than or equal to %d\n",a,b);
        }
        getch();
        }
// ------- code end ------


Output: 
               Enter first number value: 5
               Enter second number value: 5
               5 is less than or equal to 5
               5 is equal to 5
             5 is greater than or equal to 5


Note: This c programming output depends on the what numbers value are entered by the user.

I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any dought about this c programming code or input & output please comment below
If you have other question about c programming send an email by contacting us form are given on page right side and also go to contact page.
Thank You!

 

More Code »

How to print hello message in c programming

Hello Friends! welcome to my website.
Program to hello message and your name in c language. You can use this program both error(compiler and runtime error) free programs just copy and paste the programs and save your time.
This program both (compiler and runtime) error-free program just copy and paste the program and save your golden time in typing program.

Print Simple Hello Message in c language programming

------------ Code Start ----------------
     #include
     #include
      void main(){
         clrscr();
        // output hello message
        printf("Hello C Programimg Language");
         getch();
      }
------------- Code  End----------------


Output: Hello C programming Language


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any doubt about this c programming code or input & output please comment below
If you have other question about c programming send an email by contacting us form are given on page right side.
Thank You!



More Code »

Increment & decrement in c Programming


Hello Friends! Welcome to my Website,
C language based programming that is for increment and decrement operator. You can use this programming both error(compiler and runtime error) free programming just copy and paste the program and save your time.

c program to understand the use of postfix increment & decrement

------start code---------------
        #include
        #include
        void main()
        {
         int x;
         printf("Enter a Number");
         scanf("%d" &x);
         printf("Number without postfix increment/decrement is =%d\n\n",x);
         printf("Number with postfix increment is =%d\n",x++);
         printf("After postfix increment number is =%d\n",x);
         printf("Number with postfix decrement is =%d\n\n",x--);
         printf("After postfix decrement number is =%d\n",x);
         getch();
        }
----end code----------

 Note: The postfix increment or decrement is added one or subtracts one number from one time run the program line. It means when you use post-increment or decrement this line first print the same number and then print value addition or subtraction in the value.
Post means first print value then increment or decrement value.


 Output:

         Enter a Number 5
         Number without postfix increment/decrement is =5

         Number with postfix increment is =5
         After postfix increment number is =6

         Number with postfix decrement is =6
        After postfix decrement number is=5

Program to understand the use of prefix increment & decrement

------start code---------------
        #include
        #include
        void main()
        {
         int x;
         printf("Enter a Number");
         scanf("%d" &x);
         printf("Number without prefix increment/decrement is =%d\n\n",x);
         printf("Number with prefix increment is =%d\n",++x);
         printf("After prefix increment number is =%d\n",x);
         printf("Number with prefix decrement is =%d\n\n",--x);
         printf("After prefix decrement number is =%d\n",x);
         getch();
        }
----end code----------

 Note: Pre means to increment or decrement value pre print the value.

Output:

      Enter a Number 5
      Number without prefix increment/decrement is =5

      Number with prefix increment is =6
      After postfix increment number is =6

      Number with prefix decrement is =5
      After prefix decrement number is=5


I make this programming and hope you are like the post if are you like the post you can please comment and Share the post to reach more people.
If any dought about this c programming code or input & output please comment below
If you have other question about c programming send an email by contacting us form are given on page right side.
Thank You!

More Code »
Older Posts Home

About Programming Shortcut

This is a programming learning website that can help you learn and when your write your programming code. And all programming code is compiled run programming code in the following programming language C, c++, Java, php and Javascript Languages. find your programming read, understand the programming then copy and past and run your program and save your golden time to typing the program becuse you learn more in leas time. All Programming is codeing is ease to understand the programming