FliQi Education App Download
प्रश्न-बैंक · C Language

String in C Language — प्रश्न और उत्तर

C Language · 85 जाँचे हुए (verified) प्रश्न

  • 85 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
निम्नलिखित सी कोड का आउटपुट क्या होगा?

#include <stdio.h>

    void main()

    {

        char *a[3][3] = {{"hey", "hi", "hello"}, {"his", "her", "hell"}

        , {"hellos", "hi's", "hmm"}};

        printf("%s", a[1][1]);

    }
What will be the output of the following C code?

#include <stdio.h>

    void main()

    {

        char *a[3][3] = {{"hey", "hi", "hello"}, {"his", "her", "hell"}

        , {"hellos", "hi's", "hmm"}};

        printf("%s", a[1][1]);

    }
  1. Aher
  2. Bhi
  3. Cकम्पाइल टाइम एररCompile time error
  4. Dhis

सही उत्तर / Answer: (A)

हल / Solution
a एक 3×3 की दो-आयामी array है, जिसका हर खाना एक string का पता रखता है। index शून्य से शुरू होता है। a[1] दूसरी पंक्ति है, यानी his, her और hell। उसमें a[1][1] दूसरा खाना है, यानी her। इसलिए आउटपुट her है। his तो a[1][0] है और hi a[0][1] है। double quotes के भीतर single quote लिखना पूरी तरह सही है, इसलिए कोई compile error नहीं आता।
a is a 3x3 two-dimensional array, and each cell holds the address of a string. Indexing starts from zero. a[1] is the second row: his, her and hell. a[1][1] is the second cell of that row, which is her. So the output is her. his is a[1][0] and hi is a[0][1]. A single quote inside double quotes is fully valid, so there is no compile error.
प्रश्न 2उत्तर + हल
निम्नलिखित सी कोड का आउटपुट क्या होगा?

#include <stdio.h>

    void main()

    {

        char *a[3] = {"hello", "this"};

        printf("%s", a[1]);

    }
What will be the output of the following C code?

#include <stdio.h>

    void main()

    {

        char *a[3] = {"hello", "this"};

        printf("%s", a[1]);

    }
  1. Ahello
  2. Bबदलता रहता हैVaries
  3. Cthis
  4. Dकम्पाइल टाइम एररCompile time error

सही उत्तर / Answer: (C)

हल / Solution
a तीन char pointer की array है। इसमें सिर्फ़ दो मान दिए गए हैं: a[0] = "hello" और a[1] = "this"। बचा हुआ a[2] अपने आप NULL हो जाता है। कम initializer देना C में पूरी तरह सही है, इसलिए compile error नहीं आता। printf में a[1] छापा गया है, जो "this" की ओर इशारा करता है। इसलिए आउटपुट this है। hello तो a[0] है, और यह आउटपुट हर बार एक जैसा रहता है, बदलता नहीं।
a is an array of three char pointers. Only two values are given: a[0] = "hello" and a[1] = "this". The remaining a[2] is set to NULL automatically. Giving fewer initializers is fully valid in C, so there is no compile error. printf prints a[1], which points to "this". So the output is this. hello is a[0], and the output is the same every time, so it does not vary.
प्रश्न 3उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

int main()

{

    printf("\n%s ","Hello");

    printf("%.3s ","Hello");

    printf("%.2s ",2+"Hello");

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

int main()

{

    printf("\n%s ","Hello");

    printf("%.3s ","Hello");

    printf("%.2s ",2+"Hello");

    return 0;

}
  1. AHello llo llo
  2. BHello Hel ll
  3. CHello llo ll
  4. DHello Hel llo

सही उत्तर / Answer: (B)

हल / Solution
पहले printf में %s पूरा Hello छापता है। दूसरे में %.3s सिर्फ़ पहले तीन अक्षर यानी Hel छापता है, क्योंकि .3 precision है। तीसरे में 2+"Hello" का अर्थ है string के तीसरे अक्षर का पता, यानी llo। उस पर %.2s पहले दो अक्षर ll छापता है। इसलिए आउटपुट Hello Hel ll है। llo वाले विकल्पों में precision भुला दिया गया है, और दूसरे printf में llo रखना भी ग़लत है।
The first printf uses %s and prints the full Hello. The second uses %.3s, which prints only the first three characters, Hel, because .3 is the precision. In the third, 2+"Hello" is the address of the third character, so the string seen is llo. %.2s then prints its first two characters, ll. So the output is Hello Hel ll. Options with llo ignore the precision, and llo in the second place is also wrong.
प्रश्न 4उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

int main(){

    char str[]="%d Hello %d";

    printf(str,10,20);

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

int main(){

    char str[]="%d Hello %d";

    printf(str,10,20);

    return 0;

}
  1. A%d Hello %d
  2. B10 Hello 20
  3. CGarbage Hello Garbage
  4. Dकम्पाइल टाइम एररCompile time error

सही उत्तर / Answer: (B)

हल / Solution
printf का पहला argument format string होता है, चाहे वह string literal हो या char array। यहाँ str में %d Hello %d है। पहले %d की जगह 10 और दूसरे %d की जगह 20 बैठते हैं। इसलिए आउटपुट 10 Hello 20 है। दोनों %d के लिए argument दिए गए हैं, इसलिए garbage नहीं आता। %d ज्यों का त्यों नहीं छपता, क्योंकि printf उसे पढ़कर मान से बदल देता है। कोड पूरी तरह सही है, compile error नहीं आता।
The first argument of printf is the format string, whether it is a string literal or a char array. Here str holds %d Hello %d. The first %d is replaced by 10 and the second by 20. So the output is 10 Hello 20. Arguments are given for both %d, so no garbage appears. %d is not printed as it is, because printf reads it and puts the value in its place. The code is fully valid.
प्रश्न 5उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

#include<string.h>

int main()

{

    char str[] = "Welcome";

    int Len, Size;

    Len = strlen(str);

    Size = sizeof(str);

    printf("%d %d",Len, Size);

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

#include<string.h>

int main()

{

    char str[] = "Welcome";

    int Len, Size;

    Len = strlen(str);

    Size = sizeof(str);

    printf("%d %d",Len, Size);

    return 0;

}
  1. A7 7
  2. B7 8
  3. C8 8
  4. DDepends on the compiler

सही उत्तर / Answer: (B)

हल / Solution
strlen() string के अक्षर '\0' से पहले तक गिनता है। Welcome में 7 अक्षर हैं, इसलिए Len = 7। sizeof(str) पूरी array का आकार bytes में देता है। आकार नहीं लिखा, इसलिए compiler ने 7 अक्षर और '\0' के लिए 8 bytes दिए। इसलिए Size = 8 और आउटपुट 7 8 है। 7 7 में '\0' छूट गया है और 8 8 में strlen ग़लत है। char हमेशा 1 byte का है, इसलिए यह compiler पर निर्भर नहीं।
strlen() counts the characters before '\0'. Welcome has 7 characters, so Len = 7. sizeof(str) gives the size of the whole array in bytes. The array size is not written, so the compiler reserves 8 bytes: 7 characters plus the ending '\0'. So Size = 8 and the output is 7 8. The 7 7 option forgets '\0', and 8 8 counts strlen wrongly. A char is always 1 byte, so it does not depend on the compiler.
प्रश्न 6उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

#include <string.h>

int main()

{

    char s1[10] = "Hello";

    char s2[10] = "Welcome";

    strcpy(s2+2,s1+2);

    puts(s2);

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

#include <string.h>

int main()

{

    char s1[10] = "Hello";

    char s2[10] = "Welcome";

    strcpy(s2+2,s1+2);

    puts(s2);

    return 0;

}
  1. AHello
  2. Bllo
  3. CWello
  4. DWelllo

सही उत्तर / Answer: (C)

हल / Solution
strcpy(s2+2, s1+2) में src है s1+2, यानी llo। इसे s2 के तीसरे स्थान से लिखा जाता है। s2 के पहले दो अक्षर We बचे रहते हैं। उसके बाद llo और फिर '\0' आता है। इसलिए s2 = Wello बनता है। Welllo तब बनता जब लिखना s2+3 से शुरू होता। llo सिर्फ़ copy हुआ हिस्सा है, पूरी s2 नहीं। Hello तो s1 है, जिसे यहाँ छापा ही नहीं गया।
In strcpy(s2+2, s1+2), src is s1+2, which is llo. It is written starting at the third position of s2. The first two characters We stay unchanged, followed by llo and then '\0'. So s2 becomes Wello. Welllo would need copying from s2+3. llo is only the copied part, not the whole of s2. Hello is s1, which is not printed in this program at all.
प्रश्न 7उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

#include <string.h>

int main()

{

    char s1[10] = "Hello";

    char s2[10] = "Welcome";

    strcpy(s2+2,s1);

    puts(s1);

    puts(s2);

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

#include <string.h>

int main()

{

    char s1[10] = "Hello";

    char s2[10] = "Welcome";

    strcpy(s2+2,s1);

    puts(s1);

    puts(s2);

    return 0;

}
  1. AHello

    lcome
  2. BHello

    WeHello
  3. CHello

    WelHello
  4. DHello

    Whello

सही उत्तर / Answer: (B)

हल / Solution
strcpy(s2+2, s1) में dest है s2+2, यानी s2 का तीसरा स्थान। s2 के पहले दो अक्षर 'W' और 'e' वैसे ही रहते हैं। तीसरे स्थान से s1 की पूरी string Hello और उसके बाद '\0' लिखे जाते हैं। इसलिए s2 = WeHello बनता है, जो 10 की array में आराम से आ जाता है। s1 नहीं बदलता। WelHello तब बनता जब s2+3 होता। Whello और lcome इन क़दमों से बनते ही नहीं।
In strcpy(s2+2, s1), dest is s2+2, the third position of s2. The first two characters 'W' and 'e' stay as they are. From the third position, the whole string Hello and then '\0' are written. So s2 becomes WeHello, which easily fits in the array of 10. s1 is not changed. WelHello would need s2+3. Whello and lcome cannot come from these steps at all.
प्रश्न 8उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

#include <string.h>

int main()

{

    char s1[10] = "Hello";

    char s2[10] = "Welcome";

    strcpy(s2,s1+2);

    puts(s1);

    puts(s2);

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

#include <string.h>

int main()

{

    char s1[10] = "Hello";

    char s2[10] = "Welcome";

    strcpy(s2,s1+2);

    puts(s1);

    puts(s2);

    return 0;

}
  1. AHello

    Hello
  2. BHello

    Welcome
  3. CHello

    llo
  4. DHello

    lcome

सही उत्तर / Answer: (C)

हल / Solution
strcpy(dest, src) src की string को '\0' समेत dest में उतार देता है। dest की पुरानी सामग्री ऊपर से लिख दी जाती है। यहाँ src है s1+2, जो तीसरे अक्षर 'l' से शुरू होता है, यानी llo। यह s2 की शुरुआत में लिखा जाता है और उसके बाद '\0' आ जाता है। इसलिए s2 अब llo है। s1 नहीं बदलता, वह Hello ही रहता है। lcome ग़लत है, क्योंकि '\0' पुराना बचा हिस्सा काट देता है।
strcpy(dest, src) copies the src string, including '\0', into dest and overwrites what was there. Here src is s1+2, which starts at the third character 'l', so it is llo. This is written at the start of s2, followed by '\0'. So s2 becomes llo. s1 is not changed and stays Hello. lcome is wrong because the new '\0' cuts off the old leftover part of Welcome.
प्रश्न 9उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include<stdio.h>

int main(){

    char str[10];

    printf("Enter a String : ");

    scanf("%s",str);

    printf("%s",str);

    return 0;

}

इनपुट "FliQi Education" दीजिए।
Find The Output of the following code:-

#include<stdio.h>

int main(){

    char str[10];

    printf("Enter a String : ");

    scanf("%s",str);

    printf("%s",str);

    return 0;

}

Enter input as "FliQi Education".
  1. AFliQi Education
  2. BEducation
  3. CFliQi
  4. Dकुछ भी नहीं छपेगाPrint Nothing

सही उत्तर / Answer: (C)

हल / Solution
scanf में %s whitespace यानी space, tab या newline मिलते ही पढ़ना रोक देता है। इनपुट FliQi Education में FliQi के बाद space है, इसलिए str में सिर्फ़ FliQi जाता है। Education इनपुट में ही पड़ा रह जाता है। फिर printf वही FliQi छाप देता है, जो पहले छपे संदेश के बाद आता है। पूरी पंक्ति पढ़नी हो तो fgets लेना पड़ता है। इसलिए पूरा FliQi Education नहीं छपता, अकेला Education भी नहीं, और कुछ न छपना भी ग़लत है।
With %s, scanf stops reading at the first whitespace, such as a space, tab or newline. In the input FliQi Education there is a space after FliQi, so only FliQi goes into str. Education stays unread in the input. Then printf prints FliQi after the prompt message. To read a full line, fgets is needed. So the full FliQi Education is not printed, Education alone is not printed, and printing nothing is also wrong.
प्रश्न 10उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

int main()

{

    char str[]="C Language";

    printf(str);

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

int main()

{

    char str[]="C Language";

    printf(str);

    return 0;

}
  1. AC Language
  2. Bकम्पाइल टाइम एररCompile time error
  3. Cकम्पाइलर पर निर्भरDepends on compiler
  4. Dstr

सही उत्तर / Answer: (A)

हल / Solution
printf का पहला argument एक char pointer होता है, जिसे format string कहते हैं। str एक char array है। printf को देने पर यह अपने पहले अक्षर का पता बन जाता है। इसलिए printf(str) सही कोड है और compile error नहीं आता। str में कोई % चिह्न नहीं है, इसलिए पूरा पाठ जैसा है वैसा छपता है: C Language। यह compiler पर निर्भर भी नहीं है। str सिर्फ़ variable का नाम है, वह नहीं छपता।
The first argument of printf is a char pointer called the format string. str is a char array, and when passed to printf it becomes the address of its first character. So printf(str) is valid code and gives no compile error. str has no % sign, so the whole text is printed as it is: C Language. The result does not depend on the compiler. str is just the variable name, so it is not printed.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

int main()

{

    printf(" %s %s ","Hello ","FliQi");

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

int main()

{

    printf(" %s %s ","Hello ","FliQi");

    return 0;

}
  1. AHello
  2. BHello FliQi
  3. C%s Hello
  4. D%s %s Hello FliQi
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 12उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

int main()

{

    printf(" %s ","Hello","FliQi");

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

int main()

{

    printf(" %s ","Hello","FliQi");

    return 0;

}
  1. AHello FliQi
  2. B%s Hello FliQi
  3. CHello
  4. D%s Hello
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include <stdio.h>

int main()

{

    printf(" Hi %s ","Hello %s","FliQi");

    return 0;

}
Find The Output of the following code:-

#include <stdio.h>

int main()

{

    printf(" Hi %s ","Hello %s","FliQi");

    return 0;

}
  1. AHi %s Hello %s FliQi
  2. BHi %s Hello %s
  3. CHi Hello %s FliQi
  4. DHi Hello %s
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include<stdio.h>

void main(){

    char str[10] = "Welcome";

    printf("\n%s",str);

    printf("\n%s",str+3);

    printf("\n%s",str+5);

}
Find The Output of the following c program:-

#include<stdio.h>

void main(){

    char str[10] = "Welcome";

    printf("\n%s",str);

    printf("\n%s",str+3);

    printf("\n%s",str+5);

}
  1. AWelcome

    lcome

    ome
  2. BWelcome

    come

    me
  3. CWelcome

    ome

    e
  4. DWelcome

    lcome

    wel
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट ज्ञात कीजिए:

#include<stdio.h>

void main(){

    char str[]="Hello";

    printf("%.3s",str);

}
Find The Output of the following program:

#include<stdio.h>

void main(){

    char str[]="Hello";

    printf("%.3s",str);

}
  1. AHel
  2. Bllo
  3. Cell
  4. DHello
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
प्रोग्राम का आउटपुट क्या होगा?

#include<stdio.h>

void main(){

    char str[5] = {'A',100,'b',50,4};

    char *ptr = (char*)NULL;

    ptr=&str[1];

    --ptr;

    ++*ptr;

    ++ptr;

    --*ptr;

    ++ptr;

    --*ptr;

    printf("%c %c %c",str[0],str[1],str[2]);

}
What is the output of the following code?

#include<stdio.h>

void main(){

    char str[5] = {'A',100,'b',50,4};

    char *ptr = (char*)NULL;

    ptr=&str[1];

    --ptr;

    ++*ptr;

    ++ptr;

    --*ptr;

    ++ptr;

    --*ptr;

    printf("%c %c %c",str[0],str[1],str[2]);

}
  1. AA 99 c
  2. BB c a
  3. CA b c
  4. Dकम्पाइल टाइम एररCompile time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
निम्नलिखित में से कौन-सा कथन सही है?
Which of the following statements is correct?
  1. Aयदि s1==s2 हो, तो strcmp(s1, s2) 0 लौटाता हैstrcmp(s1, s2) returns 0 if s1==s2
  2. Bयदि s1==s2 हो, तो strcmp(s1, s2) 1 लौटाता हैstrcmp(s1, s2) returns 1 if s1==s2
  3. Cयदि s1>s2 हो, तो strcmp(s1, s2) 0 से छोटी संख्या लौटाता हैstrcmp(s1, s2) returns a number less than 0 if s1>s2
  4. Dयदि s1<s2 हो, तो strcmp(s1, s2) 0 से बड़ी संख्या लौटाता हैstrcmp(s1, s2) returns a number greater than 0 if s1<s2
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
string के साथ काम करने वाला कोई भी फ़ंक्शन यह कब जानता है कि string समाप्त हो गई है? जब उसे यह मिलता है:
Any function working with a string knows that the string has ended when it encounters:
  1. A"\1"
  2. Bpointer (पॉइंटर)pointer
  3. Cnull character (शून्य कैरेक्टर)null character
  4. Dख़ाली जगह (space)Empty space
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
प्रोग्राम का आउटपुट क्या होगा?

#include<stdio.h>

#include<string.h>

int main()

{

char str1[20] = "Hello", str2[20] = " World";

printf("%s\n", strcpy(str2, strcat(str1, str2)));

return 0;

}
What will be the output of the program?

#include<stdio.h>

#include<string.h>

int main()

{

char str1[20] = "Hello", str2[20] = " World";

printf("%s\n", strcpy(str2, strcat(str1, str2)));

return 0;

}
  1. AHello
  2. BWorld
  3. CHello World
  4. DWorldHello
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
printf() या scanf() फ़ंक्शन को वास्तव में क्या पास किया जाता है?
What is actually passed to the printf() or scanf() functions?
  1. Astring का मानValue of String
  2. Bstring का पता (address)Address of String
  3. Cstring का अंतिम पताEnd address of String
  4. Dstring का integer समतुल्य मानInteger equivalent value of String
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
strings के pointers वाले array के साथ इस C प्रोग्राम का आउटपुट क्या है?

#include<stdio.h>

int main()

{

    char *code[]={"IN","USA","K"};

    printf("%s", code[1]);

    return 0;

}
What is the output of this C program with an array of pointers to strings?

#include<stdio.h>

int main()

{

    char *code[]={"IN","USA","K"};

    printf("%s", code[1]);

    return 0;

}
  1. AIN
  2. BU
  3. CUSA
  4. Dकंपाइलर एररCompiler error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
इस C प्रोग्राम का आउटपुट क्या है?

#include<stdio.h>

int main()

{

    printf("%c","HUMPTY"[2]);

}
What is the output of this C program?

#include<stdio.h>

int main()

{

    printf("%c","HUMPTY"[2]);

}
  1. AU
  2. BM
  3. CHUMPTY
  4. Dउपर्युक्त में से कोई नहींNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
इस C प्रोग्राम का आउटपुट क्या है?

#include<stdio.h>

#include<string.h>

int main()

{

    char str1[]="JAMES,";

    char str2[15]="BOND ";

    strcat(str2,str1);

    printf("%s",str2);

    printf("%s",str1);

}
What is the output of this C program?

#include<stdio.h>

#include<string.h>

int main()

{

    char str1[]="JAMES,";

    char str2[15]="BOND ";

    strcat(str2,str1);

    printf("%s",str2);

    printf("%s",str1);

}
  1. AJAMES BOND,JAMES,
  2. BJAMES,JAMES,
  3. CBOND JAMES,JAMES,
  4. Dउपर्युक्त में से कोई नहींNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 27उत्तर app में
strings वाले इस C प्रोग्राम का आउटपुट क्या है?

#include<stdio.h>

int main()

{

    char str[]="MALDIVES";

    printf("%s ",str);

    puts(str);

    return 0;

}
What is the output of this C program with strings?

#include<stdio.h>

int main()

{

    char str[]="MALDIVES";

    printf("%s ",str);

    puts(str);

    return 0;

}
  1. AMALDIVES
  2. BMALDIVES MALDIVES
  3. CM MALDIVES
  4. Dउपर्युक्त में से कोई नहींNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 28उत्तर app में
strings वाले इस C प्रोग्राम का आउटपुट क्या है?

#include<stdio.h>

int main()

{

    char str[]="ANDAMAN";

    int i=0;

    while(str[i] != '\0')

    {

        printf("%c",str[i]);

        i++;

    }

    return 0;

}
What is the output of this C program with strings?

#include<stdio.h>

int main()

{

    char str[]="ANDAMAN";

    int i=0;

    while(str[i] != '\0')

    {

        printf("%c",str[i]);

        i++;

    }

    return 0;

}
  1. AAAAAAAA
  2. BANDAMAN
  3. Cकंपाइलर एररCompiler error
  4. Dउपर्युक्त में से कोई नहींNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 29उत्तर app में
strings वाले इस C प्रोग्राम का आउटपुट क्या है?

#include<stdio.h>

int main()

{

    char var='b';

    printf("%d ", sizeof("a"));

    printf("%d ", sizeof('b'));

    printf("%d ", sizeof(10));

    printf("%d ", sizeof(var));

}

//int size is 2 bytes
What is the output of this C program with strings?

#include<stdio.h>

int main()

{

    char var='b';

    printf("%d ", sizeof("a"));

    printf("%d ", sizeof('b'));

    printf("%d ", sizeof(10));

    printf("%d ", sizeof(var));

}

//int size is 2 bytes
  1. A1 1 1 1
  2. B2 1 2 1
  3. C2 2 2 1
  4. D2 2 2 2
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 30उत्तर app में
C string के elements हमेशा कहाँ स्टोर होते हैं?
The elements of a C string are always stored in:
  1. Aरैंडम मेमोरी लोकेशनRandom memory locations
  2. Bवैकल्पिक (एक छोड़कर एक) मेमोरी लोकेशनAlternate memory locations
  3. Cअनुक्रमिक (लगातार) मेमोरी लोकेशनSequential memory locations
  4. Dउपर्युक्त में से कोई नहींNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
String in C Language के सभी 85 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

C Language के दूसरे topics

सभी topics