0% found this document useful (0 votes)
38 views12 pages

Welcome! Harika Odugu SRM Institute of Science & Technology Andhra Pradesh

The document contains a quiz assessment for SRM Institute of Science & Technology, focusing on C programming questions. It includes multiple-choice questions regarding the output of various C code snippets. Additionally, it highlights the training partnership of Campus Corporate Connect and mentions the success of its alumni.

Uploaded by

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

Welcome! Harika Odugu SRM Institute of Science & Technology Andhra Pradesh

The document contains a quiz assessment for SRM Institute of Science & Technology, focusing on C programming questions. It includes multiple-choice questions regarding the output of various C code snippets. Additionally, it highlights the training partnership of Campus Corporate Connect and mentions the success of its alumni.

Uploaded by

Odugu Harika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

12/30/24, 2:32 PM CCC

Campus Corporate Connect


The most trusted training partner in India

Welcome!
Harika Odugu
SRM Institute of Science & Technology Andhra Pradesh

My Assessment

SRM AP PO - 2025 : 30 DEC 2024 Quiz 15


DAY-01 mins

1. What will be the output of the


following C code? #include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}

[Link] 1/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect


hiin India
The most trusted training partner

hello

no

error

2. What is the output of the


statement.?
#include <stdio.h>
int main()
{
printf("%f",(double)45);
return 0;
}

45

450

45.000000

[Link] 2/12
12/30/24, 2:32 PM CCC

Campus Corporate
[Link]
What
The most trusted training partner in India
is the output of the C Program.?
#include <stdio.h>
int main()
{
float a=10.0;
a = a % 3;
printf("%f", a);
return 0;
}

Compiler Error

4. #include <stdio.h>
int main()
{
int x = 0;
if (x == 0)
printf("true, ");
else if (x = 10)
printf("false, ");
printf("%d\n", x);
}

[Link] 3/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect


false, 0
The most trusted training partner in India

true, 0

true, 10

compile time error

5. #include <stdio.h>
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++)
printf("Hello");
}

Run time error

Hello is printed thrice

Hello is printed twice

Hello is printed infinitely

6. #include <stdio.h>
int main()
{
if (printf("%d", printf(")))
printf("We are Happy");
else if (printf("1"))
[Link] 4/12
12/30/24, 2:32 PM CCC

printf("We are Sad");


Campus Corporate Connect
} partner in India
The most trusted training

0We are Happy

1We are Happy

1We are Sad

compile time error

7. #include <stdio.h>
void main()
{
double ch;
printf("enter a value between 1 to
2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}

Compile time error

2
[Link] 5/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect Varies


The most trusted training partner in India

8. #include <stdio.h>
int main()
{
int a = 1;
if (a)
printf("All is Well ");
printf("I am Well\n");
else
printf("I am not a River\n");
}

Output will be All is Well I am


Well

Output will be I am Well I am


not a River

Output will be I am Well

Compile time errors during


compilation

9. #include <stdio.h>
void main()
{
int k = 0;
for (k)
printf("Hello");
}

[Link] 6/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect


Compile time error
The most trusted training partner in India

hello

nothing

varies

10. #include <stdio.h>


int main()
{
int i = 0;
for (i++; i == 1; i = 2)
printf("In for loop ");
printf("After loop\n");
}

In for loop after loop

After loop

Compile time error

Undefined behaviour

11. #include <stdio.h>


int main()
{
int a = 1;
if (a--)
printf("True");
[Link] 7/12
12/30/24, 2:32 PM CCC

if (a++)
Campus Corporate Connect
printf("False");
The most trusted training partner in India
}

true

false

true , false

no output

12. #include <stdio.h>


int main()
{
int i = 0;
for (; ; ;)
printf("In for loop\n");
printf("After loop\n");
}

Compile time error

Infinite loop

After loop

Undefined behaviour

[Link] 8/12
12/30/24, 2:32 PM CCC

Campus Corporate
[Link]
What will be the output of the
The most trusted training partner in India
following C code?
#include <stdio.h>
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}

hi

how are you

compile time error

error

14. #include <stdio.h>


void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++);
printf("%lf", k);
}

[Link] 9/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect4


The most trusted training partner in India

Run time error

15. Which of the following is an invalid


if-else statement?

if (if (a == 1)){}

if (func1 (a)){}

if (a){}

if ((char) a){}

Submit

[Link] 10/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect


We partner
The &
mosttrain students
trusted training primarily from premier Institutes in
partner in India
India
Students from 135 Institutions / Universities have benefitted from our trainings

125+ more Institutions

Our Alumni work at the best companies in the world


Our 611000+ alumni have got placed in 758 companies with 1.22Crs as highest package

730+ more Companies

[Link] 11/12
12/30/24, 2:32 PM CCC

Campus Corporate Connect CONTESTS


The most trusted training partner in India

Copyright © 2022 [Link]

Contact: info@[Link]

[Link] 12/12

You might also like