Program to enter a grade & check its corresponding remarks

This program accepts a grade as input (like A, B, C, etc.) and displays the corresponding remark using conditional statements. This is a good practice for learning if-else or switch-case in C. #include <stdio.h> int main() { char grade; // Input from user printf(“Enter your grade (A, B, C, D, F): “); scanf(” %c”, &grade); […]

Write a program to check for the relation between 2 nos

#include <stdio.h> int main() { int num1, num2; // Input two numbers from user printf(“Enter first number: “); scanf(“%d”, &num1); printf(“Enter second number: “); scanf(“%d”, &num2); // Check and display the relationship if (num1 > num2) { printf(“%d is greater than %d\n”, num1, num2); } else if (num1 < num2) { printf(“%d is less than […]

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 […]