Write a C Program to Check Whether a Number is Even or Odd

Write a program to check given number is Even number or odd number in c programming. Source code: #include<stdio.h> int main() { int n; printf(“Enter a number :”); scanf(“%d”,&n); if(n%2==0) { printf(“Given number is even”); } else { printf(“Given number is odd”); } return 0; } Output 1: Enter a number: 4 Given number is … Read more

C Conditional Statements (if, if-else, switch) – Beginner’s Guide

C Conditional Statements

Conditional statements in c programming  Conditional statements are used to check the condition.whaether condition is true or not.if condition is true it runs one statement.there are three conditional statements in c programming language. These are : 1.if statement  2.if-else Statement  3.Nested if else statement  1.if statement: First we are discussing if statement .In c program … Read more

Hello World Program in C Language – Basic C Program for Beginners

Basic c program Here we are writing basic c program to print Hello world . Program: #include<stdio.h> void main() { printf(“Hello World”); } Output: Hello World Printf() is a input function it is used to print statement on the screen. In programming c printf() and scanf() are predefined functions.these two functions are part of studio.h … Read more