Given the following code, what is going to be the output? 10 int main (int argc, char* argv[]){ 11 string a = "The Last Emperor"; int pos = 0; while ((pos = a.find(" ", pos)) != string::npos) 12 13 14 cout << a.substr(0, pos++) << endl; 15 return 0; 16 } 17
Q: Plzz complete the coding using c language and plz do not use any other library other than stdio . h
A: The C program is given below:
Q: Given float MyValues[ ]={-0.4, 3.14, 99.9, 119.99}; and int index=2; what will be displayed by the…
A: the solution is an given below :
Q: Consider this code: string name = "Mary Smith"; for (unsigned int i = 0; i < name.length(); i++) if…
A: #include<iostream>using namespace std;//driver programint main(){ string name = "Mary…
Q: Write the reverse string() function for the given code below. (Hint: use strlen() function which…
A: Algorithm for string reverse function,reverse_string : 1. Get the length of the cstring using…
Q: What is the value of len in the code below if str = "damha si eman ym": char str[20]; int i, len;…
A: What is the value of len in the code below if str = "damha si eman ym": char str[20]; int i, len;…
Q: 2. Find and remove the errors from the program given below to check whether a string is palindrome…
A: Find and remove errors from the given program to check whether a string is a palindrome or not.
Q: Based on coding below, help me fix all the error until the program can be run properly and neatly…
A: The given code is developed for showing the banking system in which creating and adding of account,…
Q: // Help me understand the code below with comments. Thanks!1 CODE: #include using namespace…
A: To perform a specific task some set of grammatical rules and vocabulary used for give instruction to…
Q: * Function: str_trim Description: effectively removes all leading and trailing whitespace from the…
A: Trim function in C
Q: a[2][1
A: A string array is set of characters in C and C plus plus languages. We can declare it and can be…
Q: Program: #include using namespace std; int main() { string s; cout>s; int length=0;…
A: According to the question below the complete Program: Program Output:
Q: e) What does each function do? Hint: Write a simple description for each of the user-defined…
A: void print_stars(): in language you can print any star patter, here you need nested loop first loop…
Q: explain the working of this code.. explain each line of this code #include using namespace std;…
A: #include <iostream> using namespace std; // main function int main(){ // a string "An…
Q: #include using namespace std; int main() { char line; cout << "Enter a string: "; cin.get…
A: cin.get() is used to access array elements. White spaces are also taken into count. normally…
Q: What would be displayed if we printed the string variable phrase after line 21?
A: Code: #include <stdio.h>#include<string.h>typedef char String10[11];int main(){…
Q: Interpret DFG and CDFG models in Embedded design?
A: The Data Flow Graph (DFG) model basically translates the data processing requirements into a data…
Q: What is the output in the following code? 1 int main() 2 {3 string cities[] = {"Atlanta", "Dallas",…
A: Lets see the solution.
Q: #include #include #include struct vaccine char name[20]; char code[5]; char country[10]; int…
A: The answer is written in step 2
Q: 8. Print all the strings of the vector given below using a foreach loop only. Print all strings in…
A: Summary: In this question, we have to write a program in C++, in which we have to print a list of…
Q: int numl =5; int num2 = int num3 = num2 % numl; if (numl + num2 > 7) 6; pow (num1,2); num3 + num2 /…
A:
Q: I need a function that takes a string and returns initials such as Bob Burnett becoming B.B. string…
A: A C++ program takes the phrase as input and displays its acronym. the acronym is an abbreviated word…
Q: Remove error from following cpp program: CODE: #include #include using namespace std; class…
A: Step 1:- Error:-
Q: In this lab, you use what you have learned about searching an array to find an exact match to…
A: #include <iostream>#include <string>using namespace std; int main() { string…
Q: Help ASAP for error free. Code
A: #include<stdio.h>#include<stdlib.h>// cscl 315int main(int argc, char *argv[]){ long int…
Q: ... #include #include #include /* * Function to check whether two passed strings are anagram…
A: #include<stdio.h>#include <conio.h>#include<string.h> /* * Function to check…
Q: Put this code into functions and make my game continuous so the player can be asked to pay again if…
A: Here our task is to run this game again and again based on the approval of user. An easy way to…
Q: bie World ------------ input 10 2 4 9 output YES */ #include using…
A: The code you provided appears to be written in C++. It takes input values and performs a bubble sort…
Q: 1 #include 2 using namespace std; 3 int main(){ int L[10],W[10],A[10],M[10],i; cout>L[i]; }…
A: Code for area of triangle:- #include <iostream> #include<conio.h>…
Q: int numl = 2; int num2 %3D 93B int num3 = num2 % num1; if (numl + num2 > 7) %3D { int num2 = num3 +=…
A: given code: int num1=2; intnum2=9; intnum3 = num2 % num1; if (num1 + num2 > 7) { intnum2 =…
Q: char t1[5] = "good"; char t2[5] = "boys"; char t3[15]; strepy (t3, t1); int nl = strlen (tl); int n2…
A: Description. 1- The output will come goodgood. How? 2- char t1[5] = "good"; // t1 is the string…
Q: omplete code Do not use ready String class functions like reverse() or arrays and array…
A: The given program is in Java language. The code with a screenshot and output is attached below:
Q: What is the output of the following code segment? char tl[5] = "good"; char t2[5] = "boys"; char…
A: The above code segment will print the content of t1 and t2 with some random garbage values. In other…
Q: // MichiganCities.cpp - This program prints a message for invalid cities in Michigan. // Input:…
A: You need to check with each and every element in the array of strings and if it equals the input…
Q: can you please remove error from deposit and withdraw section. #include #include #include using…
A: We have a C++ program of deposit and withdrawal. We need to remove the error's from the program in…
Q: 1. Identify what are the input, process and output for the following problems. a. Find the mean of 4…
A: Code : p = int(input("Enter value of P :"))q = int(input("Enter value of Q :"))r = int(input("Enter…
Q: Modify to do the following: Add data integrity handing using cin.ignore, etc. for the initial…
A: There are very small modification you can add into this. I run this code on my system and its…
Q: def sparechange(quarters, dimes, nickels, pennies): spareAMT = 25 * quarters + 10 * dimes + 5 *…
A: 1) Below is program to display equivalent dollers for the change quarters, dimes, nickels and…
Q: Task 2: Command-Line Arguments and String Copying #include #include int main(int argc, char*…
A: Let's go through each part of the task step by step:a. Execute the program with "012345678" as the…
Q: #include #include #include using
A: convert it into file handling.…
Q: fix my codes!!! #include #include int main() { char name [10][100]; int fc = 0,…
A: Errors in the program: Many variables declared as an integer types. To fix this error:…
Q: Help me fix all the error in this programme #include #include #include #include using…
A: The solution to the given problem is below.
Q: The built-in function eval takes a string and evaluates it using the Python interpreter. For…
A: Python is a general-purpose, interpreted, high-level programming language that is well-known for…
Q: 39 - Which vbScript code creates random integer numbers between -20(included) and 1O(included) ? O…
A: rnd() is used to generate a random number between 0 to 1 cint(), fix() and int() converts to integer…
Q: code
A: According to the question we need to do some changes to the code and make it unique. The Given Code…
Q: draw flowchart of following code: #include #include #include struct vacc{ char…
A: Given code for this we have to create a flow chart diagram #include <stdio.h>#include…
Q: Algorithm for the below program #include #include #include //structure typedef struct { char…
A: Algorithm for coinsChange function Function coinsChange parameter integer change *coins = (int*)…
Q: return 0; } //**** *********** *** ********** // countLetters // // task: This function counts the…
A: Algorithm: Start Read string Define 3 functions countLetters,countDigits,countWhiteSpaces for…
Step by step
Solved in 2 steps
- Q1:What is the output of the following codes? int x=3; int main(){ int x=12; { int x=10; coutb) { case 0: cout<What will be the output of the following program? struct subject{ char "sub[3];}; int main() { struct subject s[]={"A","AB A","ABC"}; char **p1,**p2,**p3,**Ptr; p1=&s->sub,p2%3D&s->sub,p3-&s->sub; char *array[3]={&p1,&p2,8&p3}; int i-0; while(* (array+i)!=NULL) { Ptr=array[i]; i++;} Ptr-=2; printf("%p\n\n","Ptr);return 0;} a. Ptr returns the value of the referenced variable, 'p2->sub' b. Ptr now points the memory address of 'p1' c. Ptr now points the memory address of 's[0]->sub' d. Ptr returns the value of the referenced variable, 's[2]->sub' e. Ptr now points the memory address of 'p2'Program: #include <stdio.h>#include <string.h>int main() { char s1[100],s2[100]; printf("Enter string1: "); gets(s1); printf("Enter string2: "); gets(s2); int i=strlen(s1); int j=strlen(s2); int count=0; while(count<=j){ s1[i]=s2[count]; count++; i++; } printf("After concatenation = %s",s1); return 0;} Q: Implement the above algorithms using functions in C++char xusername[10]; char xbankname[10]; int xaccountnum[4]; int xcardnum[14]; int xpass[4]; int xwalletnum[11]; int xOTP[4]; printf("Enjoy a range of our banking services including cash withdrawals and deposits, card and loan installment payments, bill payments, smart wallet recharge, and card-less services.\n\n\n"); printf("If you are bank staff press 1. \t\t\t If you are a customer press 2.\n"); int num;label0: scanf_s("%d", &num); if (num == 1) {//bank staff char bank_staff[10] = { "mahmoud" }; char xbank_staff[10]; int bank_pass[4] = { 5,5,5,5 }; int xbank_pass[4]; int doha = 0; labelinf1: printf("Enter your name.\n"); scanf_s("%s", xbank_staff, 10); if (strcmp(xbank_staff, bank_staff) == 0) { printf("Enter your password.\n"); scan_array(xbank_pass, 4); for (int i = 0; i < 4; i++) { if (xbank_pass[i] == bank_pass[i]) {…Transcribed Image Text #include<stdio.h> #include<string.h> #include<conio.h> #include<stdlib.h> int i; char n=1,username[16],password[ 30],ch; void welcome() { system ("@cls||clear"); printf("\t\tWECOME TO MY SITE\n"); } int main() { while(n<=3) { welcome(); printf("\n\NLOGIN HERE!"); printf("\n\nUSERNAME : "); scanf ("%s",&username); printf("PASSWORD: "); for (i=0;i<16;i++) { ch = getch(); if(ch==13) { password[i]='\0'; break; password[i]=ch; printf("*"); password[i]='\0'; printf("\n\n"); system("pause"); if(strcmp(username, "rolan")==0) if(strcmp(password, "12345")==0) { welcome(); printf("\n\NYOU'VE LOGIN SUCCESSFULLY!"); break; else welcome(); printf("\n\nWRONG PASSWORD. You have %d attempt/s left...",3-n); else welcome(); printf("\n\NUSER DOESN'I EXIST. You have %d attempt/s left...",3-n); getch(); n++; if(n==4) { welcome(); printf("\nSORRY! YOU CAN'T LOGIN."); break; getch(); } }What are the assumptions that can be made from the program below #include<stdio.h>#include<stdlib.h>#include<string.h> //structuretypedef struct{char Username[20];int cents;}value; int *coinChange(int change); //main functionint main(){ FILE *f; //open the filef = fopen("coins.txt", "r"); //check if file not openedif(f==NULL){printf("File not opened!");return 1;} value arr[10];int i, j, n, option, totalCoins;char name[20];int *coins; // = //read the filefor(i=0; !feof(f) ; i++){fscanf(f, "%s", arr[i].Username);fscanf(f, "%d", &arr[i].cents);} n = i; //close the filefclose(f); //loopwhile(1){//display menuprintf("1. Enter name\n");printf("2. Exit\n\n"); //prompt and read optionprintf("Enter option (1 or 2): ");scanf("%d", &option); //switch statementswitch(option){case 1://read the namescanf("%s", name);totalCoins = 0;//search in the listfor(i=0; i<n; i++){if(!strcmp(name, arr[i].Username)){totalCoins = totalCoins + arr[i].cents;}}//check if not…1. What is the output of the following code segment: char* s [] = { "NBY", "SDT"}; const char** z = s; const cout << z [1] [1]; cout << cout << a. DSDT b. DTY c. DTBY d. DTS e. *(z [1]+ 2); (*z + 1); None of the abovePlease give the correction from this code, where I made the mistakes. The extra two output shown here. How to remove that? #include <stdio.h>#include <stdlib.h>#include <string.h>// movie structurestruct movie {char movieName[1025];int rating;}; int main(void) { // movie structure variablestruct movie list[10];// movie structure pointer variablestruct movie *ptr = list; int ID;// assign std to ptrchar buff; for (int i = 0; i < 8; i++) { printf("Enter number %d movie name: ",i+1); //scanf("%s",&ptr->movieName); gets(ptr->movieName); printf("Enter rating: "); scanf("%d", &ptr->rating); buff = getchar(); // update pointer to point at next element ptr++;} // reset pointer back to the startingptr = list; printf("Enter your ID: ");scanf("%d",&ID); struct movie temp;for (int i = 0; i < 10; i++) { for (int j = 0; j < (9 - i); j++) { if (list[j].rating < list[j + 1].rating) {…what do I add to make every letter in between 'w' and 'f' to become 'o'?.What does the below do? #include <stdio.h>#include <string.h>int main(void) { char fnameArray[50] [50]; int i; for (i = 0; i <=5; i++) { scanf("%s", fnameArray[i] ); } for (i = 0; i <=5; i++) { printf("\n%s\n", fnameArray[i] ); } return 0;}Please fix this code for me, I'm stuck . #include<iostream>#include <iomanip>using namespace std;// the main bodyint main(){std::string item[10],name;int n;float price[10],ST_VAT[10],tax[10],total=0.0,Net;cout<<"Enter the number of items that should be atleast 5 : ";cin>>n;cout<<"Enter the customer's name ";cin>>name;for(int i=1;i<=n;i++){ std::cout<<"\nEnter the item "<<i<<" name , cost, sales tax and VAT :";cin>>name>>price[i]>>ST_VAT[i];tax[i]=price[i]+ST_VAT[i];total=total+tax[i];}Net=total-0.05*total;cout<<swet(5)<<"Food Stuff Grocery Shop"<<endl;cout<<"Customer Name"<<name<<endl;cout<<"ITEM"swet(8)<<"PRICE"<<swet(15)"Sales Tax+ VAT"<<swet(10)<<Sub-Total endl;cout<<SWET(8)<<"------------"<<swet(15)<<"--------------"<<swet(10)<<"----------"endl;for(int…This is the code I have so far, just need help with the areas that say "***". #include <string> // for string processing#include <iostream> // Access input output stream: cin coutusing namespace std; // Access cout, endl, cin without using std:: as prefix// 8 global variables and 7 prototypes of functionsstring pw; // global pw for the password to be checkedbool r1, r2, r3, r4, r5, r6, r7; // global 7 boolean flags for violationsvoid s1(); void s2(); void s3(); void s4(); void s5();void s6(); void s7(); // 7 prototypes of functions to be defined after main() int main() // like a driver to call those 7 functions to check a password {// begin of main // must return integer to the callercout << "Welcome to the PASSWORD game designed by Joel!" << endl;cout << "Please enter a password:" << endl;getline(cin, pw); // pw may have blanks anywhere, so must use getline( )cout << "Your password \"" << pw << "\" " ;while (pw != "quit") // the…SEE MORE QUESTIONS