Posts

Showing posts from November, 2022

String final questions 28

Image
String Final Questions 28/11/22 koi bug ya error mile toh batana : > 💣 android compiler apk >> compiler click here __ Q1. WAP  of string and perform these ops >> 1>cpy  2>cmp  3>con 4>leng by using functions of str..?    #include <stdio.h> #include <string.h> int main (){ int m1 , m2 , m3 , c , m4 , m5 , len1 , len2 , s ; char name1 [ 15 ]; char name2 [ 15 ]; char * result [ 35 ]; printf ( "write name 1 \n " ); gets ( name1 ); printf ( "write name 2 \n " ); gets ( name2 ); printf ( " \n what you want to do \n 1>> copy \n 2>> compare \n 3>> length \n 4>>concatenate \n " ); scanf ( " %d " ,& c ); if ( c == 1 ){ printf ( "we are coping name 1 in name 2 \n " );       strcpy ( name2 , name1 );         puts ( name2 ); } else if ( c == 2 ){ s = strcmp ( name1 , name2 );     printf ( "Comparison result = %d " , s ); } else if ( c == 3 ){ len1 = strlen ( nam

STRING QUESTION and ANSWER >>

  INDEX PAGE FOR C LANGUAGE CODES to run code in mobile >>  online compiler to ask something >>  Contact me : > use in online compiler or vs code  1.STRING CHAPTER QUESTIONS **WAP = WRITE A PROGRAM Q.1 >> WAP TO COUNT NO. OF VOWELS ,CONSONENT,SPACE AND SPECIAL CHARACTER (!@$&)? ans = // to count the number char without fun.  :: #include <stdio.h> #include <string.h> int main (){ int m1 , m2 , m3 , c , m4 , m5 , len1 , len2 , s ; char name1 [ 15 ]; char name2 [ 15 ]; char * result [ 35 ]; printf ( "write name 1 \n " ); gets ( name1 ); printf ( "write name 2 \n " ); gets ( name2 ); printf ( " \n what you want to do \n 1>> copy \n 2>> compare \n 3>> length \n 4>>concatenate \n " ); scanf ( " %d " ,& c ); if ( c == 1 ){ printf ( "we are coping name 1 in name 2 \n " );       strcpy ( name2 , name1 );         puts ( name2 ); } else if ( c == 2 ){ s = strcmp ( name1 , na