1
You visited us
1
times! Enjoying our articles?
Unlock Full Access!
Byju's Answer
Standard XII
Business Studies
Levels of Management
int main ( ) ...
Question
int main ( )
{
char P[ ] = " HYDERABAD";
char * c = P +2;
* c = 69 ;
print ("%s",P);
}
What is the output of the above program?
Open in App
Solution
(B)
char *c = P + 2 will replace the character "D' by 'E'
So, the output it HYEERABAD.
Suggest Corrections
0
Similar questions
Q.
Consider the following C program segment.
# include <stido.h>
int main ( ) {
char s1 [7] = "1234", *p;
p = s1 +2;
*p = '0';
printf ("%s", s1);
}
What will be printed by the program?
Q.
Consider the following C program:
#include <stdio.h>
struct ournode {
char x, y, z;
};
int main ( ) {
struct our node p = { '1', '0', 'a' + 2};
struct ournode *a = &p;
printf("%c,%c ", *((char*)q + 1),
*((char*) q+ 2));
return 0;
}
The output of this program is:
Q.
Consider the following C program segment:
char p[20];
char *s= "string";
int length = strlen (s) ;
for (i = 0 ; i < length; i++)
p[i] = s[length -i];
printf("%s", p);
The output of the program is
Q.
Consider the following C program:
#include <stido.h>
void fun 1 (char *s1, char *s2) {
char *tmp
tmp = s1;
s1 = s2;
s2 = tmp;
}
void fun2 (char **s1, char **s2) {
char *tmp;
tmp = * s1;
*s1 = *s2;
*s2 = tmp;
}
int main ( ) {
char * str1 = "Hi", *str2 = "Bye";
fun1 (str1, str2); printf("%s, %s", str1, str2);
fun2 (&str1, &str2);printf("%s %s", str1, str2);
return 0;
}
The output of the program above is
Q.
What does the following fragment of C program print?
char c[ ] = "GATE2011";
char *p = c;
printf("%s", p + p[3] - p[1]);
View More
Join BYJU'S Learning Program
Grade/Exam
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th grade
7th grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Submit
Related Videos
Levels of Management
BUSINESS STUDIES
Watch in App
Explore more
Levels of Management
Standard XII Business Studies
Join BYJU'S Learning Program
Grade/Exam
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th grade
7th grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Submit
Solve
Textbooks
Question Papers
Install app