study the code:
#include<stdio.h>
void main()
{
const int a=100;
int *p;
p=&a;
(*p)++;
printf("a=%dn(*p)=%dn",a,*p);
}
What is printed?
A)100,101 B)100,100 C)101,101 D)None of the
above
Answers were Sorted based on User's Feedback
Answer / santhoo035
d)None of the above
It will give compliation error at the line p=&a,pointer to
integer cannot assign to const int
Is This Answer Correct ? | 18 Yes | 1 No |
Answer / madhu
D) NONE OF THE ABOVE
COZ
ANS IS A=101n (*p)=101n
to get this *p should be an constant pointer
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sridevi.halli
answer is d)none of the above
bcoz in line p=&a it will gve error
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / abdur rab
the answer is c) 101, 101
a constant variable can be accessed using a pointer to
change the value because, during compilation the compiler
cannot see that the pointer is changing a contant read only
variable.
the same method can be applied over the private members in
a c++ class also.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / biranchi ranjan parida
none of the above
pointer value of address increases it cant store its
original value
Is This Answer Correct ? | 0 Yes | 1 No |
what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d",x); }
How can I find the day of the week given the date?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
Write a code to generate a series where the next element is the sum of last k terms.
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
Write a C Program to display the following menu: Menu 1. Display 2. Copy 3. Append 4. Exit Accept the choice (1-4) from the user, and perform the following tasks: Choice 1: Accept a file name from the user and display the file on screen Choice 2: Accept two file names, and copy first file to the second Choice 3: Accept two file names, and append second file to the first file Choice 4: Terminate the program
1 Answers Accenture, Concor, DMU, Satyam, Syntel, Tora,
how to find the kth smallest element in the given list of array elemnts.
What are compound statements?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
C program to find frequency of each character in a text file?
How will you find a duplicate number in a array without negating the nos ?
how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......