C Strings

C Strings

University

16 Qs

quiz-placeholder

Similar activities

BS TEST2

BS TEST2

University

20 Qs

BASIC C QUIZ

BASIC C QUIZ

University

15 Qs

Operators

Operators

University

12 Qs

[VARIABLES & DATA TYPES]

[VARIABLES & DATA TYPES]

University

15 Qs

No Strings Attached

No Strings Attached

University

20 Qs

Bridge course with C

Bridge course with C

University

20 Qs

C Quiz

C Quiz

University

12 Qs

C fundmentals

C fundmentals

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?