Chapter - 7: Data Types Revisited

What will be the output of the following program:


A
Sections
7
Exercises
#include<stdio.h>
void func();
int main()
{
	func();
	func();
	return 0;
}
void func()
{
	auto int i = 0;
	register int j = 0;
	static int k = 0;
	i++; j++; k++;
	printf("\n %d % d %d", i, j, k);
}

Output: 

1 1 1
1 1 2

While in some compilers (like Visual Studio), using auto as type-specifier may result in an error.


© 2021 Garbage Valuegarbage value logo