Kamis, 07 Maret 2019

Use of logical operators in c language

in this article, I share with you little code of C programming that how logical operators work.

this is an example of Marksheet where I use logical operators.


Use of logical operators in c language

#include<conio.h>
#include<stdio.h>
main()
{
      //Use of logical operator &&
     
     
      int obt_matric,obt_inter,max_matric,max_inter;
      float per_matric,per_inter;
     
      printf("Enter matriculation obtained:");scanf("%d",&obt_matric);
      printf("Enter matriculation maximum:");scanf("%d",&max_matric);
      printf("Enter intermediate obtained:");scanf("%d",&obt_inter);
      printf("Enter intermediate maximum:"); scanf("%d",&max_inter);
     
      per_matric = obt_matric*100/max_matric;
      per_inter = obt_inter*100/max_inter;
     
      if(per_matric>=80 && per_inter>=80)
      printf("Congratulation! you got double top A-1 Grade in matric And Inter");
      else
      printf("You fail to got double top"); 
     
     
      getch();} 




Simple Grading System in C programming Without Loop

The grading system is essential for students because everyone student wants that who get A grade A+ Grade in an institution or College and University.

Basically today I tell you a simple program which written on C language for the Grading system nested condition flow.

Simple Grading System in C programming Without Loop


there are so many ways to make a grading system but I'm sharing with you a very basic and very simple method Code.

so let's start.

#include<conio.h>
#include<stdio.h>
main()
{
      //Grading system - Nested conditional flow
     
     
      int obt,max;
      float per;
      printf("Grading System");
      printf("\n***************\n\n");
     
     
      printf("Enter obtained marks:"); scanf("%d",&obt);
      printf("Enter max marks:"); scanf("%d",&max);
      per = obt * 100 / max;
     
      if(per>=80)
      printf("Congrats! you got A-1 Grade");
      else if(per>=70)
      printf("Good, you got A Grade");
      else if(per>=60)
      printf("You secure B-Grade");
      else
      printf("You are fail :-( you need to work hard more");     
     
      getch();}

I hope you understood the above code.

Selasa, 05 Maret 2019

Basic C Language Tutorial for beginners

I'm telling you about Some Basic Programming Languages in Computer Science Feild. So, guys, there are many Basic Programming Languages to begin to start your career in Web development.

Today I teach you C Language. according to www.tiobe.com C Language is the second number of Top Programming Languages in the Wolrd.

There are some basic programming languages.


  • Fortran
  • COBOL
  • Pascal programming language
  • C++
  • Java
  • Visual Basic
You may also learn basic from the above-mentioned Languages.



Why I  Use C Langauge Programming for Basic?

This is true and no doubt that is the second top in the list and this is so simple and easier than other languages by my opinion. this is also can easily work on a simple note pad.

How it is Work.

it's work simply and also need an interpreter like (Dev C ++ ) because you should practice on the compiler. So you can improve your programming via practice.

so let us Start Programming.

1. Simple Program. Hello World 


#include<conio.h>
#include<stdio.h>
main()
{
      printf("Hello World");
      
      getch();}

this is Simple Program where we print hello world.

2. Size of Function 


#include<conio.h>
#include<stdio.h>
main()
{
   
      printf("Integer occupies %d bytes",sizeof(int));
      printf("\n");
      printf("float occupies %d bytes",sizeof(float));
      printf("\n");
      printf("char occupies %d bytes",sizeof(char));
   
   
      getch();}

3. Arithmetic Operator 

How Arithmetic Operators Work in below Code.


#include<conio.h>
#include<stdio.h>
main()
{
      //implementation of arithmatic operators
      
      int x,y;
      
      printf("Enter first value:");scanf("%d",&x);
      printf("Enter second value:");scanf("%d",&y);
      
      printf("\n\n");
      printf("\nSum = %d",x+y);
      printf("\nDiff = %d",x-y);
      printf("\nProduct = %d",x*y);
      printf("\nDivision = %d",x/y);
      
      
      getch();}

4. Format Specifier in print function

#include<conio.h>
#include<stdio.h>
main()
{
      //use of %d - Format Specifier in printf function
   
      int x,y;
   
      printf("Enter first value:");scanf("%d",&x);
      printf("Enter second value:");scanf("%d",&y);
   
      printf("\n\n");
      printf("\n %d + %d = %d",x,y,x+y);
      printf("\n %d - %d = %d",x,y,x-y);
      printf("\n %d * %d = %d",x,y,x*y);
      printf("\n %d / %d = %d",x,y,x/y);
   
   
      getch();} 

5. Odd-Even identification, use of modulus % operator with an if-else structure 


#include<conio.h>
#include<stdio.h>
main()
{
      //Odd - Even identification, use of modulus % operator with if-else structure
   
      int num;
   
      printf("Enter Number:");scanf("%d",&num);
   
      if(num%2 == 0)
      printf("%d is even number",num);
      else
      printf("%d is odd number",num);

   
   
      getch();}