New course! Every coder should learn Generative AI!
Try a free lesson+ 3
In c language if function data type is void and it returns 1, then it will give error or compile successfully
Void fun(){ int test=1; Return 1; }
6 Answers
+ 5
Error : no ❌
Warning : Yes ✅
Here's proof👇
https://code.sololearn.com/cjDrpx8UcQl1/?ref=app
+ 4
🐍Jasprit 🗡️ no bro it will not produce error, but it will give warning see arsenic's code
+ 2
Try this
#include <stdio.h>
void func()
{
printf("executed without error");
// return 2;
}
int main()
{
func();
return 0;
}
+ 1
Arsenic thank you bro
+ 1
Martin Taylor
Thank you bro
0
🐍Jasprit 🗡️ thank you bro