What will be the output of following program segment include

What will be the output of following program segment, #include #include void main() {char first[10] = \"bbb\"; char last[10] = \"aaa\"; char name[30]; strcpy(name, last); strcat(last, name); cout

Solution

12)answer:- b

explanation:-strcpy copies the value of variable last to variable name.. hence the name contain \"aaa\", and it is printed

13)answer:-modified code without errors..

#include<string.h>
#include<iostream>
using namespace std;
int subtraction(int a,int b)//modified
{
   int r;
   r = a-b;
   return r;
  
}
int main()
{
   int x=5,y=3,z;
   z=subtraction(7,x);//modified
   cout<<z<<endl;
   cout<<subtraction(7,2)<<endl;
   cout<<z<<endl;
}

 What will be the output of following program segment, #include #include void main() {char first[10] = \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site