Write a program to check whether the given no is even or odd

#include <stdio.h> int main() { int number; // Input number from user printf(“Enter a number: “); scanf(“%d”, &number); // Check if the number is even or odd if (number % 2 == 0) { printf(“%d is an even number.\n”, number); } else { printf(“%d is an odd number.\n”, number); } return 0; }   Explanation: […]

C and C++

Write a program to perform division of 2 nos

#include int main() { int a,b; float c; printf(“Enter 2 nos : “); scanf(“%d %d”, &a, &b); if(b == 0) { printf(“Division is not possible”); } c = a/b; printf(“quotient is %f \n”,c); return 0; } Enter 2 nos: 6 2 quotient is 3 Output: Enter 2 nos: 6 0 Division is not possible

C and C++

Operators Precedence in C

Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator. For example, x = 7 + 3 * 2; here, x is assigned 13, not 20 because operator * […]

C and C++

Operators in C

An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C language is rich in built-in operators and provides the following types of operators: Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Increment and decrement operators Conditional operators Misc Operators Arithmetic operator: These are used to perform […]

C and C++

Programming Language Translators

As you know that high-level language is machine-independent and assembly language though it is machine-dependent yet mnemonics that are being used to represent instructions are not directly understandable by the machine. Hence to make the machine understand the instructions provided by both languages, programming language instructors are used. They transform the instruction prepared by programmers […]

C and C++

Explain Programming language

A language that is acceptable to a computer system is called a computer language or programming language and the process of creating a sequence of instructions in such a language is called programming or coding. A program is a set of instructions, written to perform a specific task by the computer. A set of large […]

SI Unit System

The General Conference on Weights and Measures created and recommended the SI in 1971 for use internationally in scientific, technical, industrial, and commercial activities. The SI has a common scheme of symbols, units, and abbreviations. In order to eliminate unit misunderstanding in technical and scientific study, the SI unit is a global standard of measures. […]

sum and average of elements in the Array

#include<stdio.h> #include<conio.h> void main() { int a[20],i,sum=0; float avg=0; printf(“\n Enter the element:”); for(i=0;i<20;i++) { scanf(“%d”,&a[i]); } printf(“\n The elements in the array are:”); for(i=0;i<20;i++) { sum=sum+a[i]; } printf(“\n The Sum of elements in the array is %d”,sum); avg=sum/20; printf(“\n The Average of elements in the array is %f”,avg); getch(); }

c program to Reverse the elements in the Array

#include<stdio.h> #include<conio.h> void main() { int a[10],i; printf(“\n Enter the element:”); for(i=0;i<10;i++) { scanf(“%d”,&a[i]); } printf(“\n The elements in the array are:”); for(i=9;i<=0;i–) { printf(“%d”,a[i]); printf(“\n”); } getch(); }