0% found this document useful (0 votes)
30 views

5 String

Questions

Uploaded by

raj371860
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

5 String

Questions

Uploaded by

raj371860
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

STRING STRING

1. WAP in C to scan and print string with space. 15.WAP in C to delete first 3 char from string.
i/p: vector india coding sirji , char s[30]; i/p: char s[10]=”armstrong num”
o/p: vector india coding sirji o/p: strong num

2.WAP in C to find lenght of string using pointer. 16. WAP in c to delete digits from string .
i/p: basic_program , char s[20],*p; i/p: char s[20]=”covid19 a12b”;
o/p: lenght= 13 o/p: covid ab

3.WAP in C to count digits in string using pointer . 17. WAP in C to delete prime digit from string.
i/p: char s[20]=”p6c3s1 123 ok7”; i/p: char s[20]=”abc3456 567abc”;
o/p: count = 7 o/p: abc46 6abc
WAP in C to print ascii , octal , hex of given string.
i/p : char s[10]=”program” ; 18. WAP in C to insert a char at 2nd index in string .
o/p : p --> 112 160 70 i/p: char s[10]=”abcdef” , in=2 , ch=’9’;
r ---> o/p: ab9cdef
WAP in C to add digits in string using char pointer.
i/p: char s[20]= “123 hello by6” , *cp; 19. WAP in C to insert ‘p’ at 0th pos in same string .
o/p: sum= 12 i/p: char s[10]=”123456”, ch=’p’;
o/p: p123456
6.WAP in C to print binary of all char in string .
i/p: char s[20]=”12 ab AB”; 20. WAP in C to insert ‘p’ at 0th index , ‘q’ at 1st
o/p: index in same string using goto .
i/p: char s[10]=”123456”
7.WAP in C to count set bit all char in string. o/p: pq123456
i/p: char s[10]=”bcd”; WAP in C to count words in given string using goto.
o/p: 3 4 3 i/p:char s[20]=”hi 5 #$2 cs”;
o/p: word count= 4
8.WAP in C to check string lenght is prime or not.
i/p: char s[10]= ”pawan”; WAP in C to Capitalize first letter of word in string.
o/p: yes 5 is prime number i/p: char s[30]= “pawan coding sirji ”
o/p: Pawan Coding Sirji
9.WAP in C to check string lenght is strong or not.
i/p: char s[10]= ”vector”; 23.WAP in C to print all word lenght in string .
o/p: 6 is not strong number i/p: char s[20]= ”vector india pvt ”
o/p: 6 5 3
10.WAP in C to reverse string using while loop . WAP in C to print first word from string using goto.
i/p: char s[10]=”gnidoc 321”; i/p: char s[20]=”vector india pvt”;
o/p: 123 coding o/p: vector
11. WAP in C to reverse first 3 letter from string .
i/p: char s[10]=”gnidoc coding ”; WAP in C to print last word from string using goto.
o/p: ingdoc coding i/p: char s[20]=”vector india coding ”;
o/p: coding
12. WAP in C to delete desired char from string.
i/p:char s[20]=”acbcccab” , ch = ‘c’ 26. WAP in C to print word ending with letter ‘g’.
o/p: abab i/p: char s[20]=”c ds coding doing”;
o/p: coding doing
13. WAP in C to delete desired char only 2 times
from right side of given string using while loop. WAP in C to reverse 1st word in string using pointer.
i/p: char s[20]=”abcccababc” , ch= ‘c’ i/p: char s[20]=”vector india pvt”;
o/p: abccabab o/p: rotcev india pvt

14.WAP in C to delete 0th index char from string. 28. WAP in C to reverse last word in string .
i/p: char s[20]=”coding sirji”; i/p: char s[30]=”vector india coding 123”;
o/p: oding sirji o/p: vecor india coding 321
STRING STRING
42.WAP in C to reverse word having digit in string.
WAP in C to count vowels in string using do-while . i/p: char s[20]=“coding 123abc vector ptr1”;
i/p: s[20]=”abc pqr aeio” o/p: char s[20 =”coding cba321 vector 1rtp”
o/p: vowels count= 5
43.WAP in C to reverse word lenght > 4 in string.
30. WAP in C to sort the string in ascending order i/p: char s[20]=“ias abcde mkdir ”;
using while loop only . o/p:char s[20= “ias edcba irdkm ”;
i/p: char s[10]= ”Aa1Bb2Cc3”;
o/p: 123ABCabc 44.WAP in C to check substring is present in a
main string or not using nested while loop.
31. WAP in C to check string is Palindrome or not.
i/p: char m[20]=”123 abc”, s[10]=”abc”;
i/p: s[20]= “radar”
o/p: yes
o/p: yes

32.WAP in C to remove conjucutive spaces in string. 45. WAP in C to count substring in main string .
i/p: s[20]=”abc coding sirji” i/p: char m[20]=”abcd cd 12cd”, s[5]=”cd”
o/p: abc coding sirji o/p: count = 3 times

33. WAP in C to delete duplicate char from string. 46. WAP in C delete substring from main string .
i/p: s[20]=”abc abc ppp 122” i/p: char m[20]=”abc45 vector”,s[10]=”abc”;
o/p : abc p12 o/p: char m[20]=”45 vector”;

34.WAP in C to count duplicate char from string.


i/p: s[20]=”aaababcdeb” 47. WAP in C delete substring from main string .
o/p: a-->4 times b-->3 times i/p: char m[20]=”abc45 78abc”,s[10]=”abc”;
o/p: char m[20]=”45 78”;
35.WAP in C to reverse all words in string.
i/p: char s[20]=“coding sirji vector” 48. WAP in C to delete palindrome word from string.
o/p:char s[20]= “gnidoc ijris rotcev” i/p: char s[20]=”laxmi madam vector ”
o/p: char s[20]=”laxmi vector ”
36. WAP in C to merge 2 string to another string.
i/p: s1[10]=”1234” s2[10]=”ABCD” 49.WAP in C to replace one word with another word
o/p : s3[20]=”1A2B3C4D” i/p: char s[20]=”ab123 ab78”,
s1[10]=”ab”,s2[10]=’cs’
37. WAP in C to merge 2 string to another string. o/p: char s[20]=”cs123 cs78”;
i/p: s1[10]=”12” s2[10]=”ABCD”
o/p : s3[20]=”1A2BCD” 50.WAP in C to replace one word with another word
in string [word lenght -> same or diffrent]

38. WAP in C to find largest words in string. i/p: char s[30]=”pf123 pf78 pf”,
i/p: char s[20]=”123 vector c ds”; s1[10]=”pf”,s2[10]=’printf’ ;
o/p: vector o/p: char s[20]=”printf123 printf78 printf”;

39. WAP in C to find smallest words in string. 51.WAP in C to delete largest word from string.
i/p: char s[20]=”123 vector c ds”; i/p: char s[20]=”c vector ds coder”
o/p: c o/p: char s[20]=”c ds coder”

40. WAP in C to count each char in string .


i/p: char s[20]=”1213ac1c”; if you found any mistake or doubts in any question
o/p: 1 --> 3 , 2--> 1,3-->1 ,a-->1 ,c-->2 send mail to [email protected]

WAP in C to check 2 strings are anagram or not. after learning function topis write all above 51
i/p: char s1[10]=”2h#p”, s2[10]=”&p2h”; program using user defined function .
o/p: Yes both string Anagram

You might also like