1) Bug – Removed
semicolon from a printf statement
Error –
expected ‘;’ before ‘return’
2) Bug – Added
semicolon to main function defination
Error –
expected identifier or ‘(‘ before ‘{‘ token
3) Bug – Removed
closing braces of a function
Error –
expected declaration or statement at end of input
4) Bug - # is
removed
Error –
expected ‘=’, ’-’, ’;’, ‘asm’, ‘_attribute_’
before ‘<’ token
5) Bug – main body
is removed
Error - expected
identifier or ‘(‘ before ‘{‘ token
6) Bug – .h is
removed
Error – no
such file or directory
7) Bug – include
keyword is removed
Error –
invalid preprocessing directive
8) Bug –
parenthesis of printf function are removed
Error –
expected ‘;’ before string constant
9) Bug - parenthesis
of main function are removed
Error - expected
‘=’, ’-’, ’;’, ‘asm’, ‘_attribute_’ before ‘<’
token
10) Bug – stdio is
removed
Error - no
such file or directory
11) Bug - < and >
are removed in header declaration
Error -
#include expects “FILENAME” or <FILENAME>
12) Bug – braces
are removed in main body
Error –
expected declaration specifier before ‘printf’ and ‘return’
13) Bug – print is
used instead of printf
Error – ld
returned 1 exit status
14) Bug - : is used
for termination
Error -
expected ‘;’ before ‘:’ token
15) Bug - “ used
to end header declaration instead of >
Error –
missing terminating > character
16) Bug – no space
between return and 0
Error –
return0 undeclared
17) Bug – . is
removed between stdio and h
Error –
stdioh:no such fie or directory
18) Bug –
parenthesis are used to make a block in the main body
Error – main
declared as a function returning a function
19) Bug - * is used
at the beginning of the header declaration
Error -
expected ‘=’, ’-’, ’;’, ‘asm’, ‘_attribute_’
before ‘<’ token
20) Bug - \ is
written in printf argument
Error –
missing terminating “ character
1. Bug: # removed
Error: expected
‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘<’ token
2. Bug: <
removed
Error: invalid
preprocessing directive #includestdio; did you mean #include?
3. Bug: ( removed
Error: expected
‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘)’ token
4. Bug: { removed
Error: expected
declaration specifiers before ‘}’ token }
5. Bug: f removed
Error: ld
returned 1 exit status
6. Bug: “ removed
Error: missing
terminating " character printf(helllo world \n");
7. Bug: ; removed
Error: expected
‘;’ before ‘return’ return 0;
8. Bug: . removed
from stdio.h
Error: No such
file or directory #include<stdioh>
9. Bug: main removed
Error: expected
identifier or ‘(’ before ‘)’ token int()
10. Bug: h removed
from stdio
Error: stdio.:
No such file or directory #include<stdio.>
11. Bug: print
removed
Error: ld
returned 1 exit status
12. Bug: include
removed
Error: include
‘<stdio.h>’ or provide a declaration of ‘printf’
13. Bug: >
removed
Error: invalid
preprocessing directive #includestdio; did you mean #include?
14. Bug: ) removed
Error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘)’ token
15. Bug: } removed
Error:
expected declaration specifiers before ‘}’ token }
16. Bug: return
spelling mistake
Error: ‘retrn’
undeclared (first use in this function); did you mean ‘rewind’?
17. Bug: ” removed
Error: missing
terminating " character printf(helllo world \n");
p { margin-bottom: 0.1in; line-height: 120%; }
18. Bug: include
spelling mistake
Error: ‘retrn’
undeclared (first use in this function); did you mean ‘rewind'?
p { margin-bottom: 0.1in; line-height: 120%; }
19. Bug: n removed
from\n
Error: missing
terminating " character printf("hello world\");
20. Bug: main
spelling mistake
Error: ld
returned 1 exit status
1.
Bug:- Removed # of
header file
Error:- hello.c:1:9:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
2.
Bug:- Removed ‘{‘
below int main
Error:- hello.c:9:
error: expected ‘{’ at end of input
3.
Bug:- Removed ‘}’
before return 0
Error:- hello.c: In
function ‘main’:
hello.c:6:1: error:
expected declaration or statement at end of input
4.
Bug:- Removed ‘;’ before return 0
Error:- hello.c: In
function ‘main’:
hello.c:6:9: error:
expected ‘;’ before ‘}’ token
return 0
5.
Bug:- Removed “ in
printf
Error:-
hello.c:5:21: error: missing terminating " character
printf(Hello
Mohit\n");
6.
Bug:- Removed ‘(‘
of main
Error:- hello.c:3:9:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘)’ token
int main)
7.
Bug:- Removed ‘)’
of main
Error:- hello.c:4:1:
error: expected declaration specifiers or ‘...’ before ‘{’
token
{
8.
Bug:- Removed ‘;’
after return 0
Error:- hello.c: In
function ‘main’:
hello.c:6:9: error:
expected ‘;’ before ‘}’ token
9. Removed ‘<’ before stdio.h
Bug:-
Error:-
hello.c:1:10: error: #include expects "FILENAME" or
<FILENAME>
#include stdio.h>
10.
Bug:- wrote in
instead of int
Error:- hello.c:3:1:
error: unknown type name ‘in’; did you mean ‘int’?
in main()
11.
Bug:- Inserted ;
after main()
Error:- hello.c:4:1:
error: expected identifier or ‘(’ before ‘{’ token
{
12.
Bug:- Removed . of
stdio.h
Error:- hello.c:4:1:
error: expected identifier or ‘(’ before ‘{’ token
hello.c:1:10: fatal
error: stdioh: No such file or directory
13.
Bug:- Removed space
between int main
Error:- hello.c:3:1:
warning: return type defaults to ‘int’ [-Wimplicit-int]
intmain()
14.
Bug:- Removed ‘u’
from return
Error:- hello.c:6:1:
error: ‘retrn’ undeclared (first use in this function); did you
mean ‘rewind’?
retrn 0;
15.
Bug:- Removed ‘n’
of main
Error:- hello.c:1:2:
error: invalid preprocessing directive #incude; did you mean
#include?
hello.c: In function
‘min’:
16.
Bug:- Added extra {
Error:- hello.c:1:2:
error: invalid preprocessing directive #incude; did you mean
#include?
#incude <stdio.h>
17.
Bug:- inserted /
extra
Error:- hello.c:2:1:
error: expected identifier or ‘(’ before ‘/’ token
/
18.
Bug:- used ##
instead of #
Error:- hello.c:1:1:
error: stray ‘##’ in program
##include <stdio.h>
19.
Bug:- inserted “
extra in printf
Error:-
hello.c:5:23: warning: missing terminating " character
printf("Hello
Mohit\n"");
20.
Bug:- wrote : after
printf() instead of ;
Error:-
hello.c:5:24: error: expected ‘;’ before ‘:’ token
printf("Hello
Mohit\n"):
Error : expected =expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
2 Bug
: wrote iclude instead of include
Error : invalid preprocessing directive #iclude
3 Bug
: removed “< >” #includestdio.h
Error : error: invalid preprocessing directive #includestdio;
4
Bug : remove “.” #include<stdidh>
Error : fatal error: stdidh: No such file or directory
5
Bug : add terminator “int main():”
Error : error: expected declaration specifiers before ‘:’ token
6
Bug : wrote “it” instead of ‘int” it main()
Error : error: unknown type name ‘it’
7
Bug : removed main function “{“
Error : expected declaration specifiers before ‘}’ token
8
Bug : remove closed bracket “()” printf"hello\n";
Error : expected ‘;’ before string constant
9 Bug
: Removed (“ “) under printf
error : ‘hello’ undeclared (first use in this function);
10 Bug :
Add teminator “:” printf("hello/n");:
“
Error : error: expected expression before ‘:’ token
11 Bug :
Removed “;” printf("hello/n")
Error : expected ‘;’ before ‘return”
12 Bug :
wrote turn instead of return turn 0;
Error
: expected ‘;’ before numeric constant
13 Bug :
wrote “t0” instead of 0
Error : error: ‘t0’ undeclared (first use in this function)
14 Bug :
add 9 between main ()
Error : error: expected declaration specifiers or ‘...’ before
numeric constant
int main(9)
15 Bug :
Missed space between ‘return and 0’
Error : error: ‘returno’ undeclared (first use in this function)
15.Bug: Removed
‘.’ and added ‘, ’ in include statement
Bug – remove
‘#’ from program,
1 error - expected
‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘<’ token
bug – remove
‘\’
2 stray ‘\’ in
program
printf("hello
world"\)
bug: remove ‘
n’
3 expected ‘;’
before ‘return’
printf("hello
world"\)
bug: missing
‘”’ after \
4 missing
terminating " character
printf("hello world\");
bug:remove ‘;’after printf
5 expected
expression before ‘return’
return 0 ;
bug missing
termination sign i.e. ;
6 expected ‘;’
before ‘}’ token
return 0 ;
bug: remove
‘{‘after main
7 expected
declaration or statement at end of input
bug: retn used
instead of return
8 retn’
undeclared (first use in this function); did you mean ‘getw’?
Retn 0;
bug:add ‘else
if’ before printf
9 ‘else’
without a previous ‘if’
else
ifprintf("hello world \n");
bug: remove ‘;’
at the end of int main
10 expected ‘;’
before numeric constant
retur 0;
bug
Adding
‘ ) ’ (right parenthesis) instead of curly brace
11;error:
expected statementbefore ‘)’ token )
Bug: Used colon instead of semicolon
12Error:error:
expected ‘;’ before ‘:’ token
return 0:
bug:remvoe ‘ “’ in hello world world in print
13 hello’ undeclared (first use in this function); did you
mean ‘ftello’? printf(hello world \n");
bug:remove ‘print’
14 expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘<’ token
include<stdio.h>
bug:add extra bracket outside the closing main function ‘}’
15 expected identifier or ‘(’ before ‘return’
return 0;
bug: remove ‘return 0’ from program
16 expected identifier or ‘(’ before ‘}’ token
}
bug: add an extra brecket befor starting the program
17 expected identifier or ‘(’ before ‘{’ token
{include<stdio.h>
bug:add conio .h in program
18 conio.h: No such file or directory
#include<conio.h>
bug: add ‘while loop’ in program
19 expected expression before ‘)’ token
while()
bug:add ‘do while loop’in program
20 expected declaration or statement at end of input
}
bug:add ‘extra\’ in
21 stray ‘\’ in program
enter elements (asjdf\\\\\\\\\\)
ERROR:1
REMOVE:#
BUG:sam.c:1:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘<’ token
include<stdio.h>
^
ERROR:2
REMOVE:() FROM INT MAIN
BUG:sam.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘{’ token
{
^
ERROR:3
REMOVE 0:
BUG:sam.c: In function ‘main’:
sam.c:5:1: warning: ‘return’ with no value, in function
returning non-void
return ;
^~~~~~
sam.c:2:5: note: declared here
int main()
^~~~
ERROR:4
REMOVE . FROM #INCLUDE<STDIO.H>
BUG:sam.c:1:9: fatal error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
compilation terminated.
ERROR:5
REMOVE >from stdio.h>
BUG:sam.c:1:17: error: missing terminating > character
#include<stdio.h
^
ERROR:6
REMOVE < FROM #INCLUDE <STDIO.H>
BUG:sam.c:1:2: error: invalid preprocessing directive
#includestdio; did you mean #include?
^~~~~~~~~~~~
include
sam.c: In function ‘main’:
sam.c:4:1: warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("hello everyone/n");
^~~~~~
sam.c:4:1: warning: incompatible implicit declaration of built-in
function ‘printf’
sam.c:4:1: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’
ERROR:7
1.ERROR-Removed #
from first statement
BUG-vinay.c:1:8:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
include<stdio.h>
^
2.ERROR-Removed <
from first statement
BUG-vinay.c:1:2:
error: invalid preprocessing directive #includestdio; did you mean
#include?
^~~~~~~~~~~~
include
vinay.c: In
function ‘main’:
vinay.c:4:1:
warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf
("helloworld/n");
^~~~~~
vinay.c:4:1:
warning: incompatible implicit declaration of built-in function
‘printf’
vinay.c:4:1:
note: include ‘<stdio.h>’ or provide a declaration of
‘printf’
3.ERROR-Removed
. From stdio.h
BUG-vinay.c:1:9:
fatal error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
compilation
terminated.
4.ERROR-Removed >
from <stdio.h>
BUG-vinay.c:1:17:
error: missing terminating > character
#include<stdio.h
5.ERROR-Removed
( after the word main
BUG-vinay.c:2:9:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘)’ token
int main)
6.ERROR-Removed )
after main
BUG-vinay.c:3:1:
error: expected declaration specifiers or ‘...’ before ‘{’
token
{
^
7.ERROR-Removed {
above printf
BUG-vinay.c: In
function ‘main’:
vinay.c:4:1:
error: expected declaration specifiers before ‘printf’
printf
("helloworld/n");
^~~~~~
vinay.c:5:1:
error: expected declaration specifiers before ‘return’
return 0;
^~~~~~
vinay.c:6:1:
error: expected declaration specifiers before ‘}’ token
}
^
vinay.c:6:1:
error: expected ‘{’ at end of input
8.ERROR-Removed (
before helloworld
BUG-vin.c: In
function ‘main’:
vin.c:4:7: error:
expected ‘;’ before string constant
printf"helloworld/n");
^~~~~~~~~~~~~~
vin.c:4:21:
error: expected statement before ‘)’ token
printf"helloworld/n");
^
9.ERROR-Removed )
after helloworld
BUG-vin.c: In
function ‘main’:
vin.c:4:22:
error: expected ‘)’ before ‘;’ token
printf("helloworld/n";
^
vin.c:6:1: error:
expected ‘;’ before ‘}’ token
}
^
10.ERROR-Removed
; after helloworld
BUG-vin.c: In
function ‘main’:
vin.c:5:1: error:
expected ‘;’ before ‘return’
return 0;
^~~~~~
ERROR:7
REMOVE {
BUG:sam.c: In function ‘main’:
sam.c:4:1: error: expected declaration specifiers before ‘printf’
printf("hello everyone/n");
^~~~~~
sam.c:5:1: error: expected declaration specifiers before ‘return’
return 0 ;
^~~~~~
sam.c:6:1: error: expected declaration specifiers before ‘}’
token
}
^
sam.c:6:1: error: expected ‘{’ at end of input
ERROR:8
REMOVE }
BUG:sam.c: In function ‘main’:
sam.c:5:1: error: expected declaration or statement at end of
input
return 0 ;
^~~~~~
ERROR:9
REMOVE: “
BUG:sam.c: In function ‘main’:
sam.c:4:8: error: ‘hello’ undeclared (first use in this
function); did you mean ‘ftello’?
printf(hello everyone/n");
^~~~~
ftello
sam.c:4:8: note: each undeclared identifier is reported only once
for each function it appears in
sam.c:4:14: error: expected ‘)’ before ‘everyone’
printf(hello everyone/n");
^~~~~~~~
sam.c:4:24: warning: missing terminating " character
printf(hello everyone/n");
^
sam.c:4:24: error: missing terminating " character
printf(hello everyone/n");
^~~
sam.c:6:1: error: expected ‘;’ before ‘}’ token
}
^
ERROR:10
REMOVE ; FROM RETURN 0;
BUG:sam.c: In function ‘main’:
sam.c:6:1: error: expected ‘;’ before ‘}’ token
}
^
ERROR:11
REMOVE ; FROM PRINT F
BUG:sam.c: In function ‘main’:
sam.c:5:1: error: expected ‘;’ before ‘return’
return 0;
^~~~~~
ERROR:12
NO SPACE BETWEEN RETURN 0
BUG:sam.c: In function ‘main’:
sam.c:5:1: error: ‘return0’ undeclared (first use in this
function)
return0 ;
^~~~~~~
sam.c:5:1: note: each undeclared identifier is reported only once
for each function it appears in
ERROR:13
REMOVE F FROM PRINT F
BUG:sam.c: In function ‘main’:
sam.c:4:1: warning: implicit declaration of function ‘print’;
did you mean ‘printf’? [-Wimplicit-function-declaration]
print("hello everyone/n");
^~~~~
printf
/tmp/ccR5AnbG.o: In function `main':
sam.c:(.text+0xf): undefined reference to `print'
collect2: error: ld returned 1 exit
ERROR:14
REMOVE .H FROM # INCLUDE STDIO.H
BUG:sam.c:1:9: fatal error: stdio: No such file or directory
#include<stdio>
^~~~~~~
compilation terminated.
ERROR:15
REMOVE INT FROM INT MAIN()
BUG:sam.c:2:2: warning: return type defaults to ‘int’
[-Wimplicit-int]
main()
^~~~
ERROR:16
REMOVE THE BREACKET () FROM (HELLO WORLD)
BUG:sam.c: In function ‘main’:
sam.c:4:7: error: expected ‘;’ before string constant
printf"hello everyone/n";
^~~~~~~~~~~~~~~~~~
ERROR:17
NO SPACE BETWEEN RETURN 0
BUG:sam.c: In function ‘main’:
sam.c:5:1: error: ‘return0’ undeclared (first use in this
function)
return0 ;
^~~~~~~
sam.c:5:1: note: each undeclared identifier is reported only once
for each function it appears in
ERROR:18
REMOVE N” FROM PRINT F (HELLO WORLD/N”);
BUG:sam.c: In function ‘main’:
sam.c:4:8: warning: missing terminating " character
printf("hello everyone/);
^
sam.c:4:8: error: missing terminating " character
printf("hello everyone/);
^~~~~~~~~~~~~~~~~~
sam.c:5:1: error: expected expression before ‘return’
return 0;
^~~~~~
sam.c:6:1: error: expected ‘;’ before ‘}’ token
}
^
ERROR:19
SPACE BETWEEN PRINT F
BUG:sam.c: In function ‘main’:
sam.c:4:1: error: unknown type name ‘print’; did you mean
‘int’?
print f("hello everyone/n");
^~~~~
int
sam.c:4:9: error: expected declaration specifiers or ‘...’
before string constant
print f("hello everyone/n");
^~~~~~~~~~~~~~~~~~
ERROR:20
REMOVE ) FROM INT MAIN()
BUG:sam.c:3:1: error: expected declaration specifiers or ‘...’
before ‘{’ token
{
^
11.ERROR-Removed
0 after return
BUG-vin.c: In
function ‘main’:
vin.c:5:1:
warning: ‘return’ with no value, in function returning non-void
return ;
^~~~~~
vin.c:2:5: note:
declared here
int main()
^~~~
12.ERROR-Removed
; after return 0
BUG-vin.c: In
function ‘main’:
vin.c:6:1: error:
expected ‘;’ before ‘}’ token
}
^
13.ERROR-Removed
last }
BUG-vin.c: In
function ‘main’:
vin.c:5:1: error:
expected declaration or statement at end of input
return 0;
^~~~~~
14.ERROR-spelling
error in include
BUG-vin.c:1:2:
error: invalid preprocessing directive #nclude; did you mean
#include?
#nclude<stdio.h>
^~~~~~
include
vin.c: In
function ‘main’:
vin.c:4:1:
warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("helloworld/n");
^~~~~~
vin.c:4:1:
warning: incompatible implicit declaration of built-in function
‘printf’
vin.c:4:1: note:
include ‘<stdio.h>’ or provide a declaration of ‘printf’
15.ERROR-NO space
given between int and main
BUG-vin.c:2:1:
warning: return type defaults to ‘int’ [-Wimplicit-int]
intmain()
^~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20):
undefined reference to `main'
collect2: error:
ld returned 1 exit status
16.ERROR-Removed
f from printf
BUG-vin.c: In
function ‘main’:
vin.c:4:1:
warning: implicit declaration of function ‘print’; did you mean
‘printf’? [-Wimplicit-function-declaration]
print
("helloworld/n");
^~~~~
printf
/tmp/cc1CZWAf.o:
In function `main':
vin.c:(.text+0xf):
undefined reference to `print'
collect2: error:
ld returned 1 exit status
17.ERROR-No space
given between return and 0
BUG-vin.c: In
function ‘main’:
vin.c:5:1: error:
‘return0’ undeclared (first use in this function)
return0;
^~~~~~~
vin.c:5:1: note:
each undeclared identifier is reported only once for each function it
appears in
18.ERROR-Removed
int main() from the program
BUG-vin.c:3:1:
error: expected identifier or ‘(’ before ‘{’ token
{
^
19.ERROR-Removed
both { from the program
BUG-vin.c: In
function ‘main’:
vin.c:4:1: error:
expected declaration specifiers before ‘printf’
printf
("helloworld/n");
^~~~~~
vin.c:5:1: error:
expected declaration specifiers before ‘return’
return 0;
^~~~~~
vin.c:5:1: error:
expected ‘{’ at end of input
20.ERROR-Removed
both the ; in the program
BUG-vin.c: In
function ‘main’:
vin.c:5:1: error:
expected ‘;’ before ‘return’
return 0
^~~~~~
Error:1
Removed .
From stdio.h statement
Bug:
helo.c:2:9: fatal error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
compilation
terminated.
Error:2
Removed
#
from the 1st
line
Bug:
helo.c:1:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘<’ token
include<stdio.h>
Error:3
Removed
space from int main
Bug:
helo.c:2:1: warning: return type defaults to ‘int’
[-Wimplicit-int]
intmain()
^~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20):
undefined reference to `main'
collect2:
error: ld returned 1 exit status
Error
:4
Removed
{ from the statement
Bug:
helo.c: In function ‘main’:
helo.c:4:1:
error: expected declaration specifiers before ‘printf’
printf("welcome
to new york/n");
^~~~~~
helo.c:5:1:
error: expected declaration specifiers before ‘return’
return
0;
^~~~~~
helo.c:6:1:
error: expected declaration specifiers before ‘}’ token
}
^
helo.c:6:1:
error: expected ‘{’ at end of input
Error:5
Put
space in prinf statement
Bug:
helo.c: In function ‘main’:
helo.c:3:1:
error: expected declaration specifiers before ‘}’ token
}
^
helo.c:5:1:
error: unknown type name ‘print’; did you mean ‘int’?
print f("welcome to
new york/n");
^~~~~
int
helo.c:5:9:
error: expected declaration specifiers or ‘...’ before string
constant
print f("welcome to
new york/n");
^~~~~~~~~~~~~~~~~~~~~~~
helo.c:6:1:
error: expected declaration specifiers before ‘return’
return 0;
^~~~~~
helo.c:7:1:
error: expected declaration specifiers before ‘}’ token
}
^
helo.c:7:1:
error: expected ‘{’ at end of input
Error:6
Removed
; from the statement
Bug:
amit.c: In function ‘main’:
amit.c:6:1:
error: expected ‘;’ before ‘return’
return
0;
^~~~~~
Error 5:-
removed braces from H
p { margin-bottom: 0.25cm; line-height: 120%;
Hello.c: In function ‘main’:
Hello.c:6:7: error: expected ‘;’ before string constant
printf"Hello\n"
p { margin-bottom: 0.25cm; line-height: 120%; }
Error
6:- printf("Hello\n)":
Hello.c: In function ‘main’:
Hello.c:6:18: error: expected ‘)’ before ‘;’ token
printf("Hello\n)";
^
Hello.c:9:1: error: expected ‘;’ before ‘}’ token
p { margin-bottom: 0.25cm; line-height: 120%; }
Error 7:- int
main…... (braces missing)
Hello.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘{’ token
{
^
p { margin-bottom: 0.25cm; line-height: 120%; }
Error 8:- ……..main()
(int is missing)
Hello.c:3:2:
warning: return type defaults to ‘int’ [-Wimplicit-int]
main()
Error 9:- Semicolon removed
#include
<stdio.h>
int
main()
{
printf("hello\n")
return 0
}
Hello.c: In function
‘main’:
Hello.c:5:3: error:
expected ‘;’ before ‘return’
return 0
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
Error 10:-
#include<stdioh> ( dot missing before h)
Hello.c:1:9: fatal error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
compilation terminated.
Error
11:- #includestdio.h (bracses <> are missing)
Hello.c:1:2: error: invalid preprocessing directive #includestdio;
did you mean #include?
^~~~~~~~~~~~
include
Hello.c: In function ‘main’:
Hello.c:5:1: warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("Hello\n");
^~~~~~
Hello.c:5:1: warning: incompatible implicit declaration of built-in
function ‘printf’
Hello.c:5:1: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’
Error
12:- return ; (zero removed)
Hello.c: In function ‘main’:
Hello.c:6:3: warning: ‘return’ with no value, in function
returning non-void
return ;
^~~~~~
Hello.c:2:5: note: declared here
int main()
^~~
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
Error 13:- f("Hello\n"); (print is
removed from printf)
Hello.c: In function ‘main’:
Hello.c:5:1: warning: implicit declaration of function ‘f’
[-Wimplicit-function-declaration]
f("Hello\n");
^
/tmp/ccqX7hUH.o: In function `main':
Hello.c:(.text+0xf): undefined reference to `f'
collect2: error: ld returned 1 exit status
Error
14 :- printf(Hello\n); (double qoutes removed)
Hello.c: In function ‘main’:
Hello.c:5:13: error: stray ‘\’ in program
printf(Hello\n);
^
Hello.c:5:8: error: ‘Hello’ undeclared (first use in this
function); did you mean ‘ftello’?
printf(Hello\n);
^~~~~
ftello
Hello.c:5:8: note: each undeclared identifier is reported only once
for each function it appears in
Hello.c:5:14: error: expected ‘)’ before ‘n’
printf(Hello\n)
Error 15:- ( int
main removed )
#include<stdio.h>)
{
printf("Hello\n");
return 0 ;
}
Hello.c:2:1: error: expected identifier or ‘(’ before ‘{’
token
Error 16:-
#include (header file <stdio.h> removed)
Hello.c:1:9: error: #include expects "FILENAME" or
<FILENAME>
#include
^
Hello.c: In function ‘main’:
Hello.c:5:1: warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("Hello\n");
^~~~~~
Hello.c:5:1: warning: incompatible implicit declaration of built-in
function ‘printf’
Hello.c:5:1: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
p { margin-bottom: 0.25cm; line-height: 120%; }
Error 17:-
(#include <stdio.h> is removed)
int main()
{
printf("Hello\n");
return 0 ;
}
Hello.c: In function ‘main’:
Hello.c:5:1: warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("Hello\n");
^~~~~~
Hello.c:5:1: warning: incompatible implicit declaration of built-in
function ‘printf’
Hello.c:5:1: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’
Error 18:- (curly
braces removed)
#include<stdio.h>
int main()
printf("hello\n");
return 0;
Hello.c: In function ‘main’:
Hello.c:4:1: error: expected declaration specifiers before ‘printf’
printf("hello\n");
^~~~~~
Hello.c:5:2: error: expected declaration specifiers before ‘return’
return 0;
^~~~~~
Hello.c:5:2: error: expected ‘{’ at end of input
p { margin-bottom: 0.25cm; line-height: 120%; }
Error 19: Removed
starting both lines
{
printf("hello\n");
return 0;
}
Hello.c:2:1: error: expected identifier or ‘(’ before ‘{’
token
{
Error 20:-
#includ <stdio.h>
(e is missing
from include)
Hello.c:1:2: error: invalid preprocessing directive #includ; did you
mean #include?
#includ <stdio.h>
^~~~~~
include
Hello.c: In function ‘main’:
Hello.c:4:1: warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("hello\n");
^~~~~~
Hello.c:4:1: warning: incompatible implicit declaration of built-in
function ‘printf’
Hello.c:4:1: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’.
p { margin-bottom: 0.25cm; line-height: 120%; }
ERROR:1
hello.c: In
function ‘main’:
hello.c:7:1: error:
expected ‘;’ before ‘}’ token
}
ERROR :2
hello.c:7:1: error:
expected ‘)’ before ‘}’ token
}
^
ERROR3
hello.c:7:1: error:
expected ‘;’ before ‘}’ tokenhello.c:4:14: error: stray ‘\’
in program
printf(Hello\n");
^
hello.c:4:9: error:
‘Hello’ undeclared (first use in this function); did you mean
‘ftello’?
printf(Hello\n");
^~~~~
ftello
hello.c:4:9: note:
each undeclared identifier is reported only once for each function it
appears in
hello.c:4:15: error:
expected ‘)’ before ‘n’
printf(Hello\n");
^
hello.c:4:16:
warning: missing terminating " character
printf(Hello\n");
^
hello.c:4:16: error:
missing terminating " character
printf(Hello\n");
^~~
hello.c:7:1: error:
expected ‘;’ before ‘}’ token
}
^
ERROR:4
hello.c:4:8: error:
expected ‘;’ before string constant
printf"Hello\n");
^~~~~~~~~
hello.c:4:17: error:
expected statement before ‘)’ token
printf"Hello\n");
ERROR:5
hello.c: In function
‘main’:
hello.c:4:2: error:
expected declaration or statement at end of input
printf("Hello\n");
^~~~~~
ERROR:6
hello.c: In function
‘main’: ^
hello.c:4:2: error:
expected declaration or statement at end of input
printf("Hello\n");
^~~~~~
[root@localhost
basic.c]# vim hello.c
[root@localhost
basic.c]# gcc hello.c
hello.c: In function
‘main’:
hello.c:4:2: error:
expected declaration specifiers before ‘printf’
printf("Hello\n");
^~~~~~
hello.c:7:1: error:
expected declaration specifiers before ‘}’ token
}
^
hello.c:7:1: error:
expected ‘{’ at end of input
ERROR:7
hello.c:2:9: error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘)’ token
int main)
^
ERROR:8
hello.c:2:9: error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘)’ token
int main)
^
[root@localhost
basic.c]# vim hello.c
[root@localhost
basic.c]# gcc hello.c
hello.c:2:1: error:
unknown type name ‘in’; did you mean ‘int’?
in main()
^~
int
ERROR:9
hello.c:1:9: fatal
error: stdi.h: No such file or directory
#include<stdi.h>
^~~~~~~~
ERROR:10
hello.c:2:1: error:
unknown type name ‘nt’; did you mean ‘int’?
nt main()
^~
Error in hello word program
1. miss in
closing “ in hello string
Error:
test.c:5:10: warning: missing terminating " character
printf("hello);
^
test.c:5:10: error: missing terminating " character
printf("hello);
^~~~~~~~
test.c:7:3: error: expected expression before ‘return’
return 0;
^~~~~~
test.c:9:1: error: expected ‘;’ before ‘}’ token
}
^
2. miss in
semicolom ; in printf function
error:
test.c: In function ‘main’:
test.c:7:3: error: expected ‘;’ before ‘return’
return 0;
3. miss ‘int
‘constant in main function
error:
est.c:3:2: warning: return type defaults to ‘int’
[-Wimplicit-int]
main(){
^~~~
test.c: In function ‘main’:
test.c:7:3: error: expected ‘;’ before ‘return’
return 0;
^~~~~~
4. miss ‘0’
in return function
error:
test.c:3:2: warning: return type defaults to ‘int’
[-Wimplicit-int]
main(){
^~~~
test.c: In function ‘main’:
test.c:8:3: warning: ‘return’ with no value, in function
returning non-void
return ;
^~~~~~
test.c:3:2: note: declared here
main(){
^~~~
5. miss the end
of the ‘}’ in function
error:
test.c:7:3: error: expected declaration or statement at end of input
return
0;
6.miss close ’)’
after int main function
error:
test.c:3:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘)’ token
int main){
7. miss ‘.h’
header in include function
error:
test.c:1:9: fatal error: stdio.: No such file or directory
#include<stdio.>
^~~~~~~~
ERROR:11
hello.c:2:1: error:
unknown type name ‘it’; did you mean ‘int’?
it main()
^~
int
ERROR:12
hello.c:1:9: fatal
error: sdio.h: No such file or directory
#include<sdio.h>
^~~~~~~~
ERROR:13
hello.c:1:9: fatal
error: stio.h: No such file or directory
#include<stio.h>
^~~~~~~~
ERROR:13
hello.c:1:9: fatal
error: stdio.: No such file or directory
#include<stdio.>
^~~~~~~~
ERROR:14
hello.c:1:9: fatal
error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
ERROR:15
hello.c:1:9: fatal
error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
ERROR:16
hello.c: In function
‘main’:
hello.c:7:1: error:
expected ‘;’ before ‘}’ token
}
^
ERROR:17
hello.c: In function
‘main’:
hello.c:3:1: error:
expected declaration specifiers before ‘)’ token
)
ERROR:18
hello.c:1:8: error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘<’ token
include<stdio.h>
^
ERROR:19
hello.c:1:2: error:
invalid preprocessing directive #includestdio; did you mean #include?
^~~~~~~~~~~~
ERROR:20
hello.c: In function
‘main’:
hello.c:4:14: error:
stray ‘\’ in program
printf(Hello\n);
^
hello.c:4:9: error:
‘Hello’ undeclared (first use in this function); did you mean
‘ftello’?
printf(Hello\n);
^~~~~
ftello
hello.c:4:9: note:
each undeclared identifier is reported only once for each function it
appears in
hello.c:4:15: error:
expected ‘)’ before ‘n’
printf(Hello\n);
^
7. miss ‘.h’
header in include function
error:
test.c:1:9: fatal error: stdio.: No such file or directory
#include<stdio.>
^~~~~~~~
8.miss ‘#’ in
include header file
error:
test.c:1:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
include<stdio.h>
^
9. miss ‘output’
in ‘stdio’ header file
error:
test.c:1:9: fatal error: stdi.h: No such file or directory
#include<stdi.h>
^~~~~~~~
10. using ‘R’
instead of ‘r’ in ‘return’ function
error:
test.c:7:2: error: ‘Return’ undeclared (first use in this
function)
Return 0;
^~~~~~
test.c:7:2: note: each undeclared identifier is reported only once
for each function it appears in
test.c:7:9: error: expected ‘;’ before numeric constant
Return 0;
11: bug in
include<stdio h>
Q1.c:1:9: fatal error: stdio h: No such file or directory
#include<stdio h>
^~~~~~~~~
12: missin n in
new line \n in printf function
Q1.c: In function ‘main’:
Q1.c:4:9: warning: missing terminating " character
printf("hello world\");
^
Q1.c:4:9: error: missing terminating " character
printf("hello world\");
^~~~~~~~~~~~~~~~
Q1.c:5:2: error: expected expression before ‘return’
return 0;
^~~~~~
Q1.c:6:1: error: expected ‘;’ before ‘}’ token
}
^~~~~~
13: use single quote ‘ ‘ instead of “ ” in printf
function
Q1.c:4:9: warning: character constant too long for its type
printf('hello world\n');
^~~~~~~~~~~~~~~
Q1.c:4:9: warning: passing argument 1 of ‘printf’ makes pointer
from integer without a cast [-Wint-conversion]
In file included from Q1.c:1:0:
/usr/include/stdio.h:318:12: note: expected ‘const char * restrict’
but argument is of type ‘int’
extern int printf (const char *__restrict __format, ...);
^~~~~~
[root@localhost assignment1]# vim Q1.c
[root@localhost assignment1]# gcc Q1.c
Q1.c: In function ‘main’:
Q1.c:4:9: warning: character constant too long for its type
printf('hello world\n');
^~~~~~~~~~~~~~~
Q1.c:4:9: warning: passing argument 1 of ‘printf’ makes pointer
from integer without a cast [-Wint-conversion]
In file included from Q1.c:1:0:
/usr/include/stdio.h:318:12: note: expected ‘const char * restrict’
but argument is of type ‘int’
extern int printf (const char *__restrict __format, ...);
^~~~~~
14: bug } in
printf function
Q1.c:4:24: error: expected ‘)’ before ‘}’ token
printf("hello world\n"};
^
Q1.c:4:24: error: expected ‘;’ before ‘}’ token
Q1.c: At top level:
Q1.c:5:2: error: expected identifier or ‘(’ before ‘return’
return 0;
^~~~~~
Q1.c:6:1: error: expected identifier or ‘(’ before ‘}’ token
}
15: use ] in
closing stetement in main function
Q1.c:6:1: error: expected statement before ‘]’ token
]
^
Q1.c:6:1: error: expected declaration or statement at end of input
16: use ; after
main()
Q1.c:3:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
17: use { before
main function
Q1.c:2:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
18: do space b/w
std and io(standard input output)
Q1.c:1:9: fatal error: std io.h: No such file or directory
#include<std io.h>
^~~~~~~~~~
compilation terminated.
19: use I in
include
Q1.c:1:2: error: invalid preprocessing directive #Include; did you
mean #include?
#Include<stdi
include
Q1.c: In function ‘main’:
Q1.c:5:2: warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("hello world\n");
^~~~~~
Q1.c:5:2: warning: incompatible implicit declaration of built-in
function ‘printf’
Q1.c:5:2: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’
20: missing ‘t’
in int keyword
Q1.c:2:1: error: unknown type name ‘in’; did you mean ‘int’?
in main()
^~
int
1. Bug: Remove
terminating character >
Error :
hello.c:1:17: error: missing terminating > character
#include<stdio.h
2. 1. Bug: Remove #
Error: hello.c:1:8:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
include<stdio.h>
3. Bug : Remove
Curly bracket
Error: hello.c:7:2:
error: expected declaration or statement at end of input
return 0;
4. Bug: Remove slash
Error :
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o: In
function `_start':
(.text+0x20):
undefined reference to `main'
collect2: error: ld
returned 1 exit status
5. Bug : Remove 0
after returned
Error: hello.c:7:2:
warning: ‘return’ with no value, in function returning non-void
return ;
6. Bug : Remove f
after (printf)
Error: warning:
implicit declaration of function ‘print’; did you mean ‘printf’?
[-Wimplicit-function-declaration]
print("Hello
World\n");
7. Bug : Remove semi
colon after (;) return
Error: hello.c:7:2:
error: expected ‘;’ before ‘return’
return 0;
8. Bug : Spelling
Mistake(retun)
Error : hello.c:7:2:
error: ‘retun’ undeclared (first use in this function); did you
mean ‘rewind’?
Retun 0;
9. Bug : Remove
space between int and main
Error : hello.c:3:1:
warning: return type defaults to ‘int’ [-Wimplicit-int]
intmain()
10. Bug: Remove int
Error: warning:
return type defaults to ‘int’ [-Wimplicit-int]
main()
11. Bug : Remove .
After stdio
Error: hello.c:1:9:
fatal error: stdio`h: No such file or directory
#include<stdio`h>
12: Bug : Add space
after print f
Error : hello.c:5:2:
error: unknown type name ‘print’; did you mean ‘int’?
print f("Hello
India\n");
13: Bug : using
forward slash /
Error: Hello
India/nHello World/n
14. Bug : Remove n
after hello world
Errror :
hello.c:5:9: warning: missing terminating " character
printf("Hello
World\");
15. Bug : Remove
main
Error: hello.c:3:6:
error: expected identifier or ‘(’ before ‘)’ token
int ()
16. Bug : Remove (“
”)
Error : error:
‘Hello’ undeclared (first use in this function); did you mean
‘ftello’?
printf(Hello
World\n);
17. Bug : Remove
Include
Error : error:
invalid preprocessing directive #<
# <stdio.h>
^
hello.c: In function
‘main’:
hello.c:5:2:
warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("Hello
World\n");
18: Bug: Remove
small Bracket after (Int Main)
Error: hello.c:4:1:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘{’ token
{
19: Bug : Remove
space between return and 0
Error : hello.c: In
function ‘main’:
hello.c:6:2: error:
‘return0’ undeclared (first use in this function)
return0;
^~~~~~~
hello.c:6:2: note:
each undeclared identifier is reported only once for each function it
appears in
[root@localhost
training]#
20. Bug : write
Statement (stdio .h)
Error: hello.c:1:9:
fatal error: stdio .h: No such file or directory
#include<stdio
.h>
^~~~~~~~~~
compilation
terminated.
21. Bug: Remove
Printf
Error : Program Not
Run
22. Bug: using
Printf
Error: hello.c:5:2:
warning: implicit declaration of function ‘Printf’; did you mean
‘printf’? [-Wimplicit-function-declaration]
Printf("Hello
World\n");
1.
Root cause:
Removed ; from the print statement.
Error:
/hello.c:5:2: error: expected ‘;’ before ‘return’
return 0;
2. Root
cause: Removed # symbol from #include <stdio.h> line.
Error: /hello.c:1:9:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
include <stdio.h>
3. Root
cause: return ‘a’ without declaring a.
Error: hello.c:6:9: error: ‘a’ undeclared (first use in this
function)
return a;
4. Root cause: put
a break
.Error: /hello.c:5:2:
error: break statement not within loop or switch
break;
5. Root cause: \n is
out of “”
Error: /hello.c:4:22:
error: stray ‘\’ in program
printf("Hello
World"\n);
/hello.c:4:23: error: expected ‘)’ before ‘n’
printf("Hello
World"\n);
6. Root Cause: put
else without if
Error: /hello.c: In
function ‘main’:
./hello.c:5:2:
error: ‘else’ without a previous ‘if’
else
7. Rootcause: put
enum
Erro: hello.c:6:2:
error: expected ‘{’ before ‘return’
return 0;
8. Rootcause:
removed > from stdio.h
Error: hello.c:1:18:
error: missing terminating > character
#include <stdio.h
9. Root cause:
include <<stdio.h>>
Error: hello.c:1:10:
fatal error: <stdio.h: No such file or directory
#include
<<stdio.h>>
compilation
terminated.
10. Rootcause: scanf
=> no & operator while reading value of a from user
Error: Hello World
2
Segmentation fault
(core dumped)
11. Rootcause: 10 =
a;
Error: hello.c:6:5:
error: lvalue required as left operand of assignment
10 = a;
12. Root
cause: Break statement
Error: hello.c:5:2:
error: break statement not within loop or switch
break;
13 Root cause: case
statement
Error: /hello.c:5:5:
error: expected expression before ‘:’ token
case:
./hello.c:5:1:
error: case label not within a switch statement
case:
14. Root cause: 2.2
>>2
Error: hello.c: In
function ‘main’:
hello.c:5:6: error:
invalid operands to binary >> (have ‘double’ and ‘int’)
2.2 >> 1;
15. Root
cause: modulos on float
Error: hello.c:6:8:
error: invalid operands to binary % (have ‘float’ and ‘int’)
a = a % 10;
16. Root cause:
main(1..1)
hello.c:2:10:
error: too many decimal points in number
int main(1..1)
17. Root cause:
main(1,2,3)
Error: hello.c:2:10:
error: expected declaration specifiers or ‘...’ before numeric
constant
main(1,2,3)
hello.c:2:10:
error: expected declaration specifiers or ‘...’ before numeric
constant
int main(1,2,3,4)
18. Root cause:
printf(“hllo world\n”)()
hello.c:
In function ‘main’:
hello.c:4:2: error:
called object is not a function or function pointer
printf("Hello
World\n")();
19. Root cause:
main() ()
Error: hello.c:2:5:
error: ‘main’ declared as function returning a function
int main()()
20. Root
cause:printf()(“Hello world\n”);
Error: hello.c:4:2:
error: too few arguments to function ‘printf’
printf()("Hello
World\n");
In file included
from hello.c:1:0:
/usr/include/stdio.h:318:12:
note: declared here
extern int printf
(const char *__restrict __format, ...);
9. If given
quotation mark before opening bracket and after closing bracket in
printf statement.
Error
world.c: In function
‘main’:
world.c:4:8: error:
expected ‘;’ before string constant
printf"(Hello
World\n)";
^~~~~~~~~~~~~~~~~
10. If remove main
function in program.
Error
world.c:3:1:
error: expected identifier or ‘(’ before ‘{’ token
{
^
11. If we write a
program without header file.
Error
world.c: In
function ‘main’:
world.c:4:2:
warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("Hello
World\n");
^~~~~~
world.c:4:2:
warning: incompatible implicit declaration of built-in function
‘printf’
world.c:4:2: note:
include ‘<stdio.h>’ or provide a declaration of ‘printf’
12. If remove blank
space between int and main.
Error
world.c:2:1:
warning: return type defaults to ‘int’ [-Wimplicit-int]
intmain()
^~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20):
undefined reference to `main'
collect2: error: ld
returned 1 exit status
13. If remove ‘{‘’
and ‘’}’’ in program.
Error
world.c: In
function ‘main’:
world.c:4:2: error:
expected declaration specifiers before ‘printf’
printf("Hello
World\n");
^~~~~~
world.c:5:2: error:
expected declaration specifiers before ‘return’
return 0;}
^~~~~~
world.c:5:11: error:
expected declaration specifiers before ‘}’ token
return 0;}
^
world.c:5:11: error:
expected ‘{’ at end of input.
14. If remove “<”
and ”>” sign in header file.
Error
world.c:1:2:
error: invalid preprocessing directive #includestdio; did you mean
#include?
^~~~~~~~~~~~
include
world.c: In function
‘main’:
world.c:4:2:
warning: implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]
printf("Hello
World\n");
^~~~~~
world.c:4:2:
warning: incompatible implicit declaration of built-in function
‘printf’
world.c:4:2: note:
include ‘<stdio.h>’ or provide a declaration of ‘printf’
15. If remove
bracket in main function.
Error
[root@abhi
abhishek]# gcc world.c
world.c:3:1: error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘{’ token
{
16. If spelling
mistake in printf Function.
Error
world.c: In
function ‘main’:
world.c:4:2:
warning: implicit declaration of function ‘pintf’; did you mean
‘printf’? [-Wimplicit-function-declaration]
pintf("Hello
World\n");
^~~~~
printf
/tmp/ccC5d7mz.o: In
function `main':
world.c:(.text+0xf):
undefined reference to `pintf'
collect2: error: ld
returned 1 exit status
17. If give opening
bracket “{“ before main function.
Error
world.c: In
function ‘main’:
world.c:4:2:
warning: implicit declaration of function ‘pintf’; did you mean
‘printf’? [-Wimplicit-function-declaration]
pintf("Hello
World\n");
^~~~~
printf
/tmp/ccC5d7mz.o: In
function `main':
world.c:(.text+0xf):
undefined reference to `pintf'
collect2: error: ld
returned 1 exit status
[root@abhi
abhishek]# vim world.c
[root@abhi
abhishek]# gcc world.c
world.c:2:1: error:
expected identifier or ‘(’ before ‘{’ token
{
18. If use sigle
quote at place of quotation mark.
Error
[root@abhi
abhishek]# gcc world.c
world.c: In function
‘main’:
world.c:4:9:
warning: character constant too long for its type
printf('Hello
World\n');
^~~~~~~~~~~~~~~
world.c:4:9:
warning: passing argument 1 of ‘printf’ makes pointer from
integer without a cast [-Wint-conversion]
In file included
from world.c:1:0:
/usr/include/stdio.h:318:12:
note: expected ‘const char * restrict’ but argument is of type
‘int’
extern int printf
(const char *__restrict __format, ...);
19. If given double
bracket before semicolon in printf statement.
Error
world.c: In
function ‘main’:
world.c:4:25: error:
expected ‘;’ before ‘)’ token
printf("Hello
World\n"));
^
world.c:4:25: error:
expected statement before ‘)’ token
20. If removed .h
in header file.
Error
world.c:1:9:
fatal error: stdio: No such file or directory
#include<stdio>
^~~~~~~
@page { margin: 2cm }
p { margin-bottom: 0.25cm; line-height: 120% }
Error 1. Removing
“ # ”
hello.c:1:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘<’ token
Error 2. removing
space b/w int and main
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../crt1.o: In function
`_start':
(.text+0x18): undefined reference to `main'
Error 3. removing
double cott from printf bracket
hello.c:
In function ‘main’:
hello.c:6:9: error: ‘hello’ undeclared (first use in this
function)
hello.c:6:9: note: each undeclared identifier is reported only once
for each function it appears in
hello.c:6:15: error: expected ‘)’ before ‘world’
hello.c:6:15: error: stray ‘\’ in program
hello.c:6:22: warning: missing terminating " character [enabled
by default]
hello.c:6:15: error: missing terminating " character
.c:10:1:
error: expected ‘;’ before ‘}’ token
Error 4. write
printf function start with capital “ P “
/tmp/cc3ViKbm.o: In function `main':
hello.c:(.text+0x11): undefined reference to `Printf'
Error 5. give space
b/w “ printf ”
hello.c:
In function ‘main’:
hello.c:6:1: error: unknown type name ‘print’
hello.c:6:9: error: expected declaration specifiers or ‘...’
before string constant
Error 6. remove
close curly braces “ } ”
hello.c:
In function ‘main’:
hello.c:8:1: error: expected declaration or statement at end of input
Error 7. removing
semicolon from return statement
hello.c:
In function ‘main’:
hello.c:10:1: error: expected ‘;’ before ‘}’ token
Error 8. replace
semicolon with colon in printf statement
hello.c:
In function ‘main’:
hello.c:6:25: error: expected ‘;’ before ‘:’ token
Error 9. removing
dot “ . ” from header file stdio.h
hello.c:1:20: fatal error: stdioh: No such file or directory
compilation terminated.
Error 10. removing
headerfile
hello.c:
In function ‘main’:
hello.c:6:1: warning: incompatible implicit declaration of built-in
function ‘printf’ [enabled by default]
Error 11. write
headerfile first latter in uppre case
hello.c:1:3: error: invalid preprocessing directive #Include
hello.c: In
function ‘main’:
hello.c:6:1: warning: incompatible implicit declaration of built-in
function ‘printf’ [enabled by default]
Error 12. replace
semicolon with “ , ” in return statement
hello.c:
In function ‘main’:
hello.c:10:1: error: expected expression before ‘}’ token
Error 13. write a
character after semicolon in printf statement
hello.c: In function ‘main’:
hello.c:6:27: error: ‘f’ undeclared (first use in this function)
hello.c:6:27: note: each undeclared identifier is reported only once
for each function it appears in
hello.c:8:1: error: expected ‘;’ before ‘return’
Error 14. write any
character after close doublecott
hello.c: In function ‘main’:
hello.c:6:24: error: expected ‘)’ before ‘i’
Error 15. write
semicolon after main funtion
hello.c:4:1: error: expected identifier or ‘(’ before ‘{’
token
{
Error 16. write
bracket after return statement return ();
hello.c:4:1: error: expected identifier or ‘(’ before ‘{’
token
{
Error 17. write
return and return value withtogather
hello.c:
In function ‘main’:
hello.c:8:1: error: ‘return0’ undeclared (first use in this
function)
return0;
^~~~~~~
hello.c:8:1: note: each undeclared identifier is reported only once
for each function it appears in
Error 18. write
comma after close doublecott
hello.c: In
function ‘main’:
hello.c:8:1: error: ‘return0’ undeclared (first use in this
function)
return0;
^~~~~~~
hello.c:8:1: note: each undeclared identifier is reported only once
for each function it appears in
[
Error 19. write
semicolon before close bracket
hello.c: In
function ‘main’:
hello.c:6:24: error: expected ‘)’ before ‘;’ token
printf("
hello world/n";);
Error 20. remove
open curly braces
hello.c: In
function ‘main’:
hello.c:4:1: error: expected declaration specifiers before ‘printf’
printf("
hello world/n";);
^~~~~~
hello.c:4:25: error: expected declaration specifiers before ‘)’
token
printf("
hello world/n";);
^
hello.c:6:1: error: expected declaration specifiers before ‘return’
return 0;
^~~~~~
hello.c:8:1: error: expected declaration specifiers before ‘}’
token
}
^
hello.c:8:1: error: expected ‘{’ at end of input
ERROR
1) removed ; in
printf
hello.c:6:2: error:
expected ‘;’ before ‘return’
return(0);
2)removed ) before ;
hello.c:5:22: error:
expected ‘)’ before ‘;’ token
printf("hello
world";
^
hello.c:7:1: error:
expected ‘;’ before ‘}’ token
3)remove (“ “)
in printf
hello.c:5:9: note:
each undeclared identifier is reported only once for each function it
appears in
hello.c:5:15: error:
expected ‘)’ before ‘world’
printf(hello
world);
4)
removing ; in from
return0
hello.c:8:1: error:
expected ‘;’ before ‘}’ token
}
5) removing int from
main
hello.c:3:2:
warning: return type defaults to ‘int’ [-Wimplicit-int]
main()
6)removing hash from
library
hello.c:1:8: error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘<’ token
include<stdio.h>
7)removing header
file
hello.c:4:2:
warning: incompatible implicit declaration of built-in function
‘printf’
hello.c:4:2: note:
include ‘<stdio.h>’ or provide a declaration of ‘printf’
8)removing
parathesis of main function
hello.c:4:2:
warning: incompatible implicit declaration of built-in function
‘printf’
hello.c:4:2: note:
include ‘<stdio.h>’ or provide a declaration of ‘printf’
9) removing closing
bracket of main finction
hello.c:5:10: error:
expected declaration or statement at end of input
return(0);
10) spelling
mistake of printf
ello.c:4:2: warning:
implicit declaration of function ‘print’; did you mean ‘printf’?
[-Wimplicit-function-declaration]
print(" hello
world" );
^~~~~
printf
/tmp/ccmy4vPk.o: In
function `main':
hello.c:(.text+0xf):
undefined reference to `print'
collect2: error: ld
returned 1 exit status
11) removing bracket
of stdio.h
hello.c:4:2:
warning: incompatible implicit declaration of built-in function
‘printf’
hello.c:4:2: note:
include ‘<stdio.h>’ or provide a declaration of ‘printf
12) replacing int
with void
hello.c:5:16:
warning: ‘return’ with a value, in function returning void
return(0);
^
hello.c:2:7: note:
declared here
void main()
13) removing bracket
of printf
hello.c: In function
‘main’:
hello.c:4:8: error:
expected ‘;’ before string constant
printf" hello
world";
14) removing zero(0)
from return
hello.c:5:16: error:
expected expression before ‘)’ token
return();
15) removing (.h)
from stdio
hello.c:1:9: fatal
error: stdio: No such file or directory
#include<stdio>
^~~~~~~
compilation
terminated.
16) missing single
bracket of main
hello.c:3:1:
error: expected declaration specifiers or ‘...’ before ‘{’
token
17) used colon
instead of semicolon
hello.c:5:18: error: expected ‘;’ before ‘:’ token
return(0):
18) remove printf
command
hello.c: In
function ‘main’:
hello.c:4:4:
error: unknown type name ‘hello’
hello world/n ;
^~~~~
hello.c:4:15:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘/’ token
hello world/n ;
19) extra characrer
after commas of printf
hello.c:4:26:
error: expected ‘)’ before ‘hi’
print( "
hello world/n "hi ) ;
20) backspace error
in main() function
hello.c:2:1:
warning: return type defaults to ‘int’ [-Wimplicit-int]
intmain()
^~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20):
undefined reference to `main'
ERROR IN HELLO WORLD
1.Removing hash(#) before include
hello.c:1:8: error:
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘<’ token
1 |
include<stdio.h>
| ^
2.removed dot(.)
from stdio.h
hello.c:1:9: fatal
error: stdioh: No such file or directory
1 |
#include<stdioh>
|
^~~~~~~~
compilation
terminated.
3.removing
semicolon
hello.c: In function
‘main’:
hello.c:4:26: error:
expected ‘;’ before ‘return’
4 | printf
("hello world\n")
|
^
|
;
5 | return 0;
| ~~~~~~
4.removing p from
printf
hello.c: In function
‘main’:
hello.c:4:2:
warning: implicit declaration of function ‘rintf’
[-Wimplicit-function-declaration]
4 | rintf
("hello world\n");
| ^~~~~
hello.c:4:2:
warning: incompatible implicit declaration of built-in function
‘rintf’
hello.c:2:1: note:
include ‘<math.h>’ or provide a declaration of ‘rintf’
1 |
#include<stdio.h>
+++ |+#include
<math.h>
2 | int main()
hello.c:4:9: error:
incompatible type for argument 1 of ‘rintf’
4 | rintf
("hello world\n");
|
^~~~~~~~~~~~~~~
| |
| char
*
hello.c:4:9: note:
expected ‘float’ but argument is of type ‘char *’
5.removing
terminator in stdio.h
hello.c:1:17: error:
missing terminating > character
1 |
#include<stdio.h
|
^
6. removed #include
hello.c:1:1: error: expected identifier or ‘(’ before ‘<’ token
1 | <stdio.h>
| ^
7. removed } after return
hello.c: In function ‘main’:
hello.c:5:2: error: expected declaration or statement at end of input
5 | return 0 ;
| ^~~~~~
8. removed brackets () from hello world
hello.c: In function ‘main’:
hello.c:4:8: error: expected ‘;’ before string constant
4 | printf "hello world\n" ;
| ^~~~~~~~~~~~~~~~
| ;
9.removed ” from hello world
hello.c: In function ‘main’:
hello.c:4:10: warning: missing terminating " character
4 | printf ("hello world\n) ;
| ^
hello.c:4:10: error: missing terminating " character
4 | printf ("hello world\n) ;
| ^~~~~~~~~~~~~~~~~
hello.c:5:2: error: expected expression before ‘return’
5 | return 0 ;
| ^~~~~~
hello.c:5:12: error: expected ‘;’ before ‘}’ token
5 | return 0 ;
| ^
| ;
6 | }
| ~
10. removed space between return 0
hello.c: In function ‘main’:
hello.c:5:2: error: ‘return0’ undeclared (first use in this function)
5 | return0;
| ^~~~~~~
hello.c:5:2: note: each undeclared identifier is reported only once for each function it appears in
11. uppercase P in printf
hello.c: In function ‘main’:
hello.c:4:2: warning: implicit declaration of function ‘Printf’; did you mean ‘printf’? [-Wimplicit-function-declaration]
4 | Printf ("hello world\n") ;
| ^~~~~~
| printf
/usr/bin/ld: /tmp/ccvRCIGF.o: in function `main':
hello.c:(.text+0xf): undefined reference to `Printf'
collect2: error: ld returned 1 exit status
12. removing<stdio.h>
ello.c:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
hello.c: In function ‘main’:
hello.c:4:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
4 | printf ("hello world\n") ;
| ^~~~~~
hello.c:4:2: warning: incompatible implicit declaration of built-in function ‘printf’
hello.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | #include
13. removed { before printf
hello.c: In function ‘main’:
hello.c:3:1: error: expected declaration specifiers before ‘printf’
3 | printf("helloworld\n");
| ^~~~~~
hello.c:4:2: error: expected declaration specifiers before ‘return’
4 | return 0;
| ^~~~~~
hello.c:5:1: error: expected declaration specifiers before ‘}’ token
5 | }
| ^
hello.c:6: error: expected ‘{’ at end of input
6 |
|
14.removing < before stdio.h
hello.c:1:2: error: invalid preprocessing directive #includestdio
1 | #includestdio.h>
| ^~~~~~~~~~~~
hello.c: In function ‘main’:
hello.c:4:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
4 | printf("helloworld\n");
| ^~~~~~
hello.c:4:2: warning: incompatible implicit declaration of built-in function ‘printf’
hello.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | #includestdio.h>
15.removing “ before helloworld
hello.c: In function ‘main’:
hello.c:4:19: error: stray ‘\’ in program
4 | printf(helloworld\n");
| ^
hello.c:4:9: error: ‘helloworld’ undeclared (first use in this function)
4 | printf(helloworld\n");
| ^~~~~~~~~~
hello.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
hello.c:4:19: error: expected ‘)’ before ‘n’
4 | printf(helloworld\n");
| ^~
| )
hello.c:4:21: warning: missing terminating " character
4 | printf(helloworld\n");
| ^
hello.c:4:21: error: missing terminating " character
4 | printf(helloworld\n");
| ^~~
hello.c:5:12: error: expected ‘;’ before ‘}’ token
5 | return 0;
| ^
| ;
6 | }
| ~
16. remove space between int & main
hello.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
2 | intmain()
| ^~~~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
17.REMOVED ( FROM main()
hello.c:2:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘)’ token
2 | int main)
| ^
18.removed main()
hello.c:3:1: error: expected identifier or ‘(’ before ‘{’ token
3 | {
| ^
19.removed ) from main()
hello.c:3:1: error: expected declaration specifiers or ‘...’ before ‘{’ token
3 | {
| ^
20. removed stdio.h
hello.c:1:9: error: empty filename in #include
1 | #include<>
| ^~
hello.c: In function ‘main’:
hello.c:4:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
4 | printf("helloworld\n");
| ^~~~~~
hello.c:4:2: warning: incompatible implicit declaration of built-in function ‘printf’
hello.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | #include<>
21.removed main
hello.c:2:6: error: expected identifier or ‘(’ before ‘)’ token
2 | int ()
| ^
errors in helloworld
1. hello.c: In
function ‘main’:
hello.c:6:1:
error: expected ‘;’ before ‘return’
return 0;
2. hello.c:7:1:
error: expected ‘;’ before ‘}’ token
}
^
3. hello.c:4:16:
error: missing terminating " character
printf("Hello);
^~~~~~~~
hello.c:6:1:
error: expected expression before ‘return’
return 0;
^~~~~~
hello.c:7:1:
error: expected ‘;’ before ‘}’ token
}
^
4. hello.c:3:1:
error: expected identifier or ‘(’ before ‘{’ token
{
^
5. hello.c:3:1:
error: expected identifier or ‘(’ before ‘{’ token
{
^
6. hello.c:1:9:
fatal error: stdioh: No such file or directory
#include<stdioh>
^~~~~~~~
compilation
terminated.
7. hello.c:6:1:
error: expected ‘)’ before ‘return’
return 0;
^~~~~~
hello.c:7:1:
error: expected ‘;’ before ‘}’ token
}
^
8. hello.c:6:1:
error: expected declaration or statement at end of input
return 0;
^~~~~~
9. hello.c:2:11:
error: expected declaration specifiers or ‘...’ before ‘]’
token
void main(]
^
hello.c:2:11:
error: expected ‘;’, ‘,’ or ‘)’ before ‘]’ token
10. hello.c:2:10:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘{’ token
void main{}
^
hello.c:3:1:
error: expected identifier or ‘(’ before ‘{’ token
{
^
11. gcc: error: helo.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
12. hello.c:2:1: warning: data definition has no type or storage class
voidmain();
^~~~~~~~
hello.c:2:1: warning: type defaults to ‘int’ in declaration of ‘voidmain’ [-Wimplicit-int]
hello.c:3:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
13. hello.c: In function ‘main’:
hello.c:6:1: error: ‘return0’ undeclared (first use in this function)
return0;
^~~~~~~
hello.c:6:1: note: each undeclared identifier is reported only once for each function it appears in
14. hello.c: In function ‘main’:
hello.c:6:8: warning: ‘return’ with a value, in function returning void
return 0
^
hello.c:2:6: note: declared here
void main()
^~~~
hello.c:8:1: error: expected ‘;’ before ‘}’ token
}
^
15. hello.c: In function ‘main’:
hello.c:6:1: error: expected identifier before ‘return’
return 0;
^~~~~~
16. hello.c: In function ‘main’:
hello.c:6:1: error: expected expression before ‘return’
return 0;
^~~~~~
17. hello.c: In function ‘main’:
hello.c:6:1: error: expected expression before ‘return’
return 0;
^~~~~~
18. hello.c: In function ‘main’:
hello.c:4:25: error: expected expression before ‘/’ token
printf("Hello");/
^
19. hello.c: In function ‘main’:
hello.c:4:25: error: expected expression before ‘:’ token
printf("Hello");:
^
20. hello.c: In function ‘main’:
hello.c:6:1: error: expected expression before ‘return’
return 0;
^~~~~~
1. if we remove #
programing.c:1:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
include<stdio.h>
^
2. if we use void maim
programing.c: In function ‘main’:
programing.c:7:8: warning: ‘return’ with a value, in function returning void
return 0;
^
programing.c:3:6: note: declared here
void main()
^~~~
3. if we remove (.) before h
programing.c:1:10: fatal error: stdioh: No such file or directory
#include <stdioh>
^~~~~~~~
4. when we remove small bracket after main
programing.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
{
^
5. when we not use {
programing.c:11:1: error: expected ‘{’ at end of input
6. if we do not use the statement terminator ;
programing.c:7:1: error: expected ‘;’ before ‘return’
return 0;
^~~~~~
7.id we do not write print instead of printf
programing.c: In function ‘main’:
programing.c:5:2: warning: implicit declaration of function ‘print’; did you mean ‘printf’? [-Wimplicit-function-declaration]
print("hello world \n");
^~~~~
printf
programing.c:7:8: warning: ‘return’ with a value, in function returning void
return 0;
^
programing.c:3:6: note: declared here
void main()
^~~~
/tmp/cceY8LDk.o: In function `main':
programing.c:(.text+0xf): undefined reference to `print'
collect2: error: ld returned 1 exit status
8. if we use statement terminator after main function
programing.c:4:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
9.if we use double ## before include
programing.c:1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
##include <stdio.h>
^
10. if we use double .. between stdio & h
programing.c:1:10: fatal error: stdio..h: No such file or directory
#include <stdio..h>
^~~~~~~~~~
11.if we do not use ( “ ) before hello world
programing.c:11:1: error: expected ‘;’ before ‘}’ token
}
^
12. if mistake the spelling of stdio.h then
programing.c:1:10: fatal error: stdo.h: No such file or directory
#include <stdo.h>
^~~~~~~~
13. when we use .l instead of .h
programing.c:1:10: fatal error: stdo.l: No such file or directory
#include <stdo.l>
^~~~~~~~
compilation terminated.
14.if we use () instead of <> then,
programing.c:1:10: error: #include expects "FILENAME" or <FILENAME>
#include (stdo.h)
^
programing.c: In function ‘main’:
programing.c:5:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
printf("hello world \n");
^~~~~~
programing.c:5:2: warning: incompatible implicit declaration of built-in function ‘printf’
programing.c:5:2: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
programing.c:7:8: warning: ‘return’ with a value, in function returning void
return 0;
^
programing.c:3:6: note: declared here
void main()
^~~~
15.if we use statement terminator before curly bracket }
programing.c:1:10: fatal error: stdo.h: No such file or directory
#include <stdo.h>
^~~~~~~~
compilation terminator
16. if use statement terminator after <stdio.h>;
programing.c:1:19: warning: extra tokens at end of #include directive
#include <stdio.h>;
^
programing.c: In function ‘main’:
programing.c:7:8: warning: ‘return’ with a value, in function returning void
return 0;
^
programing.c:3:6: note: declared here
void main()
^~~~
17. if we use equal to = before printf
programing.c: In function ‘main’:
programing.c:5:8: error: lvalue required as left operand of assignment
printf=("hello world \n");
^
programing.c:7:8: warning: ‘return’ with a value, in function returning void
return 0;
^
programing.c:3:6: note: declared here
void main()
^~~~
18.when we use {}curly bracket after main
programing.c:3:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
void main{}
^
programing.c:4:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
19.if we do not use main function
programing.c:4:1: error: expected identifier or ‘(’ before ‘{’ token
{
^
20.if we use double statement terminator
programing.c: In function ‘main’:
programing.c:7:8: warning: ‘return’ with a value, in function returning void
return 0;
^
programing.c:3:6: note: declared here
void main()
^~~~
21.printf("a is %d and b is %d "a,b);
add.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main()
^~~~
add.c: In function ‘main’:
add.c:5:30: error: expected ‘)’ before ‘a’
printf("a is %d \n b is %d" a,b);
^
22. printf("a is %d \n b is %d",a,b\n);
add.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main()
^~~~
add.c: In function ‘main’:
add.c:5:33: error: stray ‘\’ in program
printf("a is %d \n b is %d",a,b\n);
^
add.c:5:34: error: expected ‘)’ before ‘n’
printf("a is %d \n b is %d",a,b\n);
23 printf("hello world\n)";
error.c: In function ‘main’:
error.c:4:24: error: expected ‘)’ before ‘;’ token
printf("hello world\n)";
^
error.c:7:1: error: expected ‘;’ before ‘}’ token
}
^
^
helloworld.c:4:12: error: expected ‘;’ before string constant
4 | printf"hello world\n";
| ^~~~~~~~~~~~~~~
| ;.c:1:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
helloworld1 | include <stdio.h>
|
helloworld.c:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include stdio.h>
| ^~~~~
helloworld.c:1:10: fatal error: stdio.h: No such file or directory
1 | #include < stdio.h>
| ^~~~~~~~~~
helloworld.c:4:2: error: expected declaration specifiers before ‘printf’
4 | printf("hello world\n");
| ^~~~~~
helloworld.c:5:2: error: expected declaration specifiers before ‘return’
5 | return 0;
| ^~~~~
helloworld.c:6:1: error: expected declaration specifiers before ‘}’ token
6 | }
helloworld.c:7: error: expected ‘{’ at end of input
helloworld.c:4:25: error: expected ‘;’ before ‘return’
4 | printf("hello world\n")
| ^
| ;
5 | return 0;
helloworld.c:5:2: error: expected declaration or statement at end of input
5 | return 0;
helloworld.c:4:18: error: expected ‘)’ before ‘world’
4 | printf(hello world\n");
| ^~~~~~
| )
helloworld.c:4:24: error: stray ‘\’ in program
4 | printf(hello world\n");
| ^
helloworld.c:4:26: warning: missing terminating " character
4 | printf(hello world\n");
helloworld.c:5:15: error: expected ‘;’ before ‘}’ token
5 | return 0;
| ^
|helloworld.c:4:29: error: expected ‘;’ before ‘return’
4 | printf("hello world\n")
| ^
| ;
5 | return 0 ;
helloworld.c:2:2: error: expected identifier or ‘(’ before ‘)’ token
2 | ()
| ^
helloworld.c:1:10: fatal error: stdio.h : No such file or directory
1 | #include < stdio.h >
| ^~~~~~~~~~~
helloworld.c:4:12: error: expected ‘;’ before string constant
4 | printf"hello world\n";
| ^~~~~~~~~~~~~~~
| ;
1. Remove # from include line.
hallo.c:1:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
1 | include<stdio.h>
| ^
2.Remove <from include line.
hallo.c:1:2: error: invalid preprocessing directive #includestdio
1 | #includestdio.h>
| ^~~~~~~~~~~~
hallo.c: In function ‘main’:
hallo.c:5:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
5 | printf("hallo marry\n");
| ^~~~~~
hallo.c:5:2: warning: incompatible implicit declaration of built-in function ‘printf’
hallo.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
+++ |+#include <stdio.h>
1 | #includestdio.h>
3.Remove > from include line.
hallo.c:1:17: error: missing terminating > character
1 | #include<stdio.h
| ^
4.Remove . from stdio.h.
hallo.c:1:9: fatal error: stdioh: No such file or directory
1 | #include<stdioh>
| ^~~~~~~~
compilation terminated.
5.Remove ( from int main line.
hallo.c:3:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘)’ token
3 | int main)
| ^
6.Remove { before printf.
hallo.c: In function ‘main’:
hallo.c:5:2: error: expected declaration specifiers before ‘printf’
5 | printf("hallo marry\n");
| ^~~~~~
hallo.c:6:2: error: expected declaration specifiers before ‘return’
6 | return 0;
| ^~~~~~
hallo.c:7:1: error: expected declaration specifiers before ‘}’ token
7 | }
| ^
hallo.c:7: error: expected ‘{’ at end of input
7 | }
|
7. Remove ) after int main(.
hallo.c:4:1: error: expected declaration specifiers or ‘...’ before ‘{’ token
4 | {
| ^
8.Remove f from printf.
hallo.c: In function ‘main’:
hallo.c:5:2: warning: implicit declaration of function ‘print’; did you mean ‘printf’? [-Wimplicit-function-declaration]
5 | print("hallo marry\n");
| ^~~~~
| printf
/usr/bin/ld: /tmp/ccgI5SFv.o: in function `main':
hallo.c:(.text+0x15): undefined reference to `print'
collect2: error: ld returned 1 exit status
9.Remove ( before starting of hello word.
hallo.c: In function ‘main’:
hallo.c:5:8: error: expected ‘;’ before string constant
5 | printf"hallo marry\n");
| ^~~~~~~~~~~~~~~
| ;
hallo.c:5:23: error: expected statement before ‘)’ token
5 | printf"hallo marry\n");
| ^
10.Remove ) after marry\n"
hallo.c: In function ‘main’:
hallo.c:5:24: error: expected ‘)’ before ‘;’ token
5 | printf("hallo marry\n";
| ^
| )
hallo.c:6:11: error: expected ‘;’ before ‘}’ token
6 | return 0;
| ^
| ;
7 | }
| ~
11.Remove 0 after return
hallo.c: In function ‘main’:
hallo.c:6:2: warning: ‘return’ with no value, in function returning non-void
6 | return ;
| ^~~~~~
hallo.c:3:5: note: declared here
3 | int main()
| ^~~~
12.Remove ; after return 0
hallo.c: In function ‘main’:
hallo.c:6:10: error: expected ‘;’ before ‘}’ token
6 | return 0
| ^
| ;
7 | }
| ~
13.Remove last }
hallo.c: In function ‘main’:
hallo.c:6:2: error: expected declaration or statement at end of input
6 | return 0;
| ^~~~~~
13.Remove int
hallo.c:3:2: warning: return type defaults to ‘int’ [-Wimplicit-int]
3 | main()
| ^~~~
15.Remove #include <stdio.h> line,
hallo.c:1:2: error: invalid preprocessing directive #<
1 | #<stdio.h>
| ^
hallo.c: In function ‘main’:
hallo.c:5:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
5 | printf("hallo marry\n");
16.Remove ”hallo marry\n” and find the error.
hallo.c: In function ‘main’:
hallo.c:5:9: error: ‘hallo’ undeclared (first use in this function)
5 | printf(hallo marry\n);
| ^~~~~
hallo.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
hallo.c:5:14: error: expected ‘)’ before ‘marry’
5 | printf(hallo marry\n);
| ^~~~~~
| )
hallo.c:5:20: error: stray ‘\’ in program
5 | printf(hallo marry\n);
| ^
It looks like you're new here. If you want to get involved, click one of these buttons!