edited by
1,485 views
2 2 votes
#include <stdio.h>
int main(void) {
	double a=30;
	int r:
	r=a%5;
	printf("\n r=%d",r)
	return 0;
}

Why this code is throwing compilation error ?

2 Answers

Position:
Show:

Related questions

12 12 votes
1 1 answer
1.1k
1.1k views
GO Classes asked Jul 2
1,105 views
Assume:$\texttt{short = 2 bytes}$, $\texttt{int = 4 bytes}$, $\texttt{char = 1 byte}$$\texttt{int}$ needs $4$-byte alignment and the final structure size is rounded to a ...
14 14 votes
2 2 answers
579
579 views
GO Classes asked Jul 2
579 views
Assume:struct Student { double gpa; }; struct Student alice; struct Student *sptr = &alice;Which of the following correctly assigns $\texttt{4.0}$ to $\texttt{alice.gpa}$...
9 9 votes
1 1 answer
441
441 views
GO Classes asked Jul 2
441 views
Consider the following code idea from the source:typedef struct { double x, y; } Point; void reset(Point p) { p.x = p.y = 0; } int main() { Point a = {12.0, 42.0}; Point ...
6 6 votes
1 1 answer
423
423 views
GO Classes asked Jul 2
423 views
What is printed by the following program?#include <stdio.h struct Student { int id, year; char grade; }; int main() { struct Student s; s.id = 10001; s.year = 2010; s.gra...