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 / jitendra kumar arya
(d),because n treat as a chracter.
ans is 100n ,101n
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / venkataramani kumar.t.b.
The Answer is C) a=101 and (*p)=101.
Since the variable is not directly accessed and it
increments thru' the pointer, so the answer is valid
| Is This Answer Correct ? | 2 Yes | 5 No |
What is printf () in c?
Why do we need volatile in c?
What is the most efficient way to store flag values?
a c code by using memory allocation for add ,multiply of sprase matrixes
What is the use of keyword VOLATILE in C?
How can I generate floating-point random numbers?
How to compare array with pointer in c?
Write a routine that prints out a 2-D array in spiral order!
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
Why can arithmetic operations not be performed on void pointers?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
5 Answers TCS, Vimukti Technologies,
What is gets() function?