0% found this document useful (0 votes)
4 views

Snippet Error on c language

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Snippet Error on c language

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Snippet Error

1.#include <stdio.h>

int main()

a = 10;

printf("The value of a is : %d", a);

return 0;

2.#include <stdio.h>

int main()

int a=2;

if(.)

printf("a is greater than 1");

return 0;

3.#include <stdio.h>

int main()

int a=2;

int b=2/0;

printf("The value of b is : %d", b);

return 0;

}
4.#include <stdio.h>

int Main()

int a=78;

printf("The value of a is : %d", a);

return 0;

#include <stdio.h>

int main()

a = 10;

printf("The value of a is : %d", a);

return 0;

5.#include <stdio.h>

int main()

int a=2;

if(.)

printf("a is greater than 1");

return 0;

6.#include <stdio.h>

int main()

int a=2;

int b=2/0;
printf("The value of b is : %d", b);

return 0;

7.#include <stdio.h>

int Main()

int a=78;

printf("The value of a is : %d", a);

return 0;

8.#include <stdio.h>

int main()

int sum=0; // variable initialization

int k=1;

for(int i=1;i<=10;i++); // logical error, as we put the semicolon after loop

sum=sum+k;

k++;

printf("The value of sum is %d", sum);

return 0;

You might also like