What is the difference between = and == in C?
Answer Posted / k.s. karthick prabu
= is the assigment operator
=is used to copy
ex:
a=5 means, copy just that value for 'a'.
== is comparision operator
ex:
#include<stdio.h>
void main()
{
int a;
scanf("%d",&a);
if(a==5)
printf("welcome");
else
printf("if the is not equal to 5");
}
| Is This Answer Correct ? | 37 Yes | 7 No |
Post New Answer View All Answers
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
Define the process of handling in case of destructor failure?
what is the use of void main() in C++ language?
What is ios in c++?
What do c++ programmers do?
Why is c++ not purely object oriented?
What do manipulators do?
What is helper in c++?
Can we specify variable field width in a scanf() format string? If possible how?
Differentiate between a constructor and a destructor in c++.
How would you find out if a linked-list is a cycle or not?
What is the difference between function overloading and operator overloading?
What is endl c++?
What is the default width for ouputting a long integer using the insertion operator?
What are the two types of comments?