C operators are special symbols used to perform operations on variables and values. These include arithmetic, relational, logical, and assignment operators.
C ऑपरेटर विशेष प्रतीक होते हैं जो वेरिएबल्स और मानों पर ऑपरेशन करने के लिए उपयोग किए जाते हैं। इनमें अंकगणितीय, तुलनात्मक, लॉजिकल और असाइनमेंट ऑपरेटर शामिल हैं।
#include
int main() {
int a = 5, b = 3;
printf("Sum = %d", a + b);
return 0;
}
Explanation (English): Adds two numbers.
व्याख्या (हिंदी): दो संख्याओं को जोड़ता है।
Output: Sum = 8
#include
int main() {
int a = 5, b = 3;
printf("Difference = %d", a - b);
return 0;
}
Explanation (English): Subtracts second number from first.
व्याख्या (हिंदी): दूसरी संख्या को पहली से घटाता है।
Output: Difference = 2
#include
int main() {
int a = 5, b = 3;
printf("Product = %d", a * b);
return 0;
}
Explanation (English): Multiplies two numbers.
व्याख्या (हिंदी): दो संख्याओं को गुणा करता है।
Output: Product = 15
#include
int main() {
int a = 10, b = 2;
printf("Quotient = %d", a / b);
return 0;
}
Explanation (English): Divides first number by second.
व्याख्या (हिंदी): पहली संख्या को दूसरी से भाग देता है।
Output: Quotient = 5
#include
int main() {
int a = 10, b = 3;
printf("Remainder = %d", a % b);
return 0;
}
Explanation (English): Gives remainder of division.
व्याख्या (हिंदी): भाग करने के बाद बचा हुआ शेषफल देता है।
Output: Remainder = 1
#include
int main() {
int a = 5, b = 3;
printf("a > b: %d", a > b);
return 0;
}
Explanation (English): Checks if a is greater than b.
व्याख्या (हिंदी): जांचता है कि a, b से बड़ा है या नहीं।
Output: a > b: 1
#include
int main() {
int a = 2, b = 4;
printf("a < b: %d", a < b);
return 0;
}
Explanation (English): Checks if a is less than b.
व्याख्या (हिंदी): जांचता है कि a, b से छोटा है या नहीं।
Output: a < b: 1
#include
int main() {
int a = 4, b = 4;
printf("a == b: %d", a == b);
return 0;
}
Explanation (English): Checks if a is equal to b.
व्याख्या (हिंदी): जांचता है कि a, b के बराबर है या नहीं।
Output: a == b: 1
#include
int main() {
int a = 5, b = 3;
printf("a != b: %d", a != b);
return 0;
}
Explanation (English): Checks if a is not equal to b.
व्याख्या (हिंदी): जांचता है कि a, b से अलग है या नहीं।
Output: a != b: 1
#include
int main() {
int a = 1, b = 0;
printf("a && b: %d", a && b);
return 0;
}
Explanation (English): Returns true if both a and b are true.
व्याख्या (हिंदी): दोनों सही होने पर true देता है।
Output: a && b: 0
#include
int main() {
int a = 1, b = 0;
printf("a || b: %d", a || b);
return 0;
}
Explanation (English): Returns true if at least one is true.
व्याख्या (हिंदी): कम से कम एक सही हो तो true देता है।
Output: a || b: 1