c program for assignment operator
#include <stdio.h>
int main() {
int a = 5;
int b;
b = a; // Assignment operator
printf("The value of b is: %d\n", b);
return 0;
}
- Include the standard input-output library.
- Define the main function.
- Declare an integer variable
a
and initialize it with the value 5. - Declare another integer variable
b
without initializing it. - Use the assignment operator (
=
) to assign the value ofa
tob
. - Print the value of
b
usingprintf
statement. - Return 0 to indicate successful execution of the program.