Posts

A simple Program to Add two integers in C

Image
 

A simple Hello World Program in C

Image
 

Switch-Case Magic: Checking Vowels and Consonants in C

Image
In this code I used only one variable for inputting a alphabetical character from user and I used switch cases for checking vowels. I had written all the possible outcomes of vowels and printed that the character is vowel, and the default case prints character is consonant or character is not an alphabet. the switch case ends and run perfectly.   Main Keywords and variables used in this code: 1.We included stdio.h, conio.h. 2.then, we use void keyword and main function to run this code. 3.then, we defined variables char. 4.then, we inputted an alphabetic character from user. 5.then, we use switch and case statements for printing the vowel. 6.then, we use getch for viewing the result. 7.and then the code ends.   If you'd like to use this code, feel free to copy it from here: #in...

Basic calculator in c

Image
  In this code I used different variables for different-different calculations. First of all, I inputted the number first and second from the users and then the operator for a specific calculation like +, -, *, /, ^. Here I defined the work of variables and then I used the conditional statements for choosing right operator for calculations. In the condition the condition check that the character "op" is equal to operator inputted by users or not if true then it print the solution and if the user enter wrong operator or number, it will print "Incorrect Number or Operator, try again.". Main Keywords and variables used in this code: 1.We included stdio.h, conio.h, and math.h file. 2.then, we use int keyword and main function to run this code. 3.then, we defined variables int and char. 4.then, we inputted numbers and operator. 5.then, we store the instructions or work in the individual variable. 6.then, we use if-else statements for printing right solution of the operat...