C Strings

C Strings

University

16 Qs

quiz-placeholder

Similar activities

B11-PSCP-Class Test-2

B11-PSCP-Class Test-2

University

20 Qs

C programming-1

C programming-1

University

13 Qs

C - Structures

C - Structures

University

20 Qs

BOP-1

BOP-1

University - Professional Development

15 Qs

CP_Second Series Test

CP_Second Series Test

University

20 Qs

Conocimientos básicos de C

Conocimientos básicos de C

University

20 Qs

Playing with C

Playing with C

University

20 Qs

CP-String

CP-String

University

18 Qs

C Strings

C Strings

Assessment

Quiz

Computers

University

Hard

Created by

Sivakami R

Used 92+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following program?

#include <stdio.h>


int main()


{


char str1[] = "Sona BME";


char str2[] = "Sona BME";


printf("%d" ,(strcmp(str1, str2)));


}

0

1

-1

error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following program?

#include <stdio.h>


int main()


{

char str1[] = "Salem";


char str2[] = "Bangalore";


printf("%d" ,(strcmp(str1, str2)));


}

0

-1

1

Compile time Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following program?

#include <stdio.h>


int main()


{

char str1[] = "Australia";


char str2[] = "India";


printf("%d" ,(strcmp(str1, str2)));


}

0

-1

1

run time error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the output of the following program?

#include <stdio.h>

int main()

{

char str1[] = "College";

char str2[] = "University";

strcpy(str1, str2);

printf("%s", str1);

}

College

University

College University

University College

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the output of the following program?

#include <stdio.h>

int main()

{

char str1[] = " Sona College";

char str2[] = "Sona University";

strcpy(str1, str2);

printf("%s", str2);

}

Sona College

Sona University

Sona College Sona University

Sona University Sona College

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be thee output of the following program?

#include <stdio.h>

int main()

{

char str[] = " Have a Good Day ! ";

printf("%d", strlen(str));

}

20

13

19

18

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code?

#include <stdio.h>

int main()

{

char str1[] = "BioMedical ";

char str2[] = "Engineering";

strcat(str1, str2);

printf("%s ", str1);

}

BioMedical

BioMedical Engineering

BioEngineering

Engineering

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?