InidBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming Java Programming
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test
Group Disucssion HR Interview Questions Technical Interview Questions Body Language

Exercise

"Hold a true friend with both hands."
- (Proverb)

C Programming - Strings

@ : Home > C Programming > Strings > General Questions
1. 

How will you print \n on the screen?

A. printf("\n");B. echo "\\n";
C. printf('\n');D.
printf("\\n");

2. 

Which of the following function is correct that finds the length of a string?

A.
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
    {    length++; s++; }
    return (length);
}
B.
int xstrlen(char s)
{
    int length=0;
    while(*s!='\0')
        length++; s++;
    return (length);
}
C.
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        length++;
    return (length);
}
D.
int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        s++;
    return (length);
}

3. 

Which of the following function is used to find the first occurrence of a given string in another string?

A. strchr()B. strrchr()
C.
strstr()
D. strnset()

4. 

The library function used to reverse a string is

A. strstr()B.
strrev()
C. revstr()D. strreverse()

5. 

Which of the following function is more appropriate for reading in a multi-word string?

A. printf();B. scanf();
C.
gets();
D. puts();



© 2008-2010 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy