what would be the output of the following program?
main()
{
int k = 123;
char *ptr;
ptr = &k;
printf("%d",*ptr);
}
Answer Posted / srsabariselvan
The program results in compilation error.
NOTE: a pointer can stores the address of same data type.
it can't store the address of another data type.
i.e.,
character pointer can stores the address of character data.
it can't store the address of integer data.
Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Lists the benefits of c programming language?
How can I avoid the abort, retry, fail messages?
How can I delete a file?
Why & is used in scanf in c?
How a string is stored in c?
What is the use of ?
What is difference between class and structure?
Can you assign a different address to an array tag?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
Write a function that will take in a phone number and output all possible alphabetical combinations
Dont ansi function prototypes render lint obsolete?
How many loops are there in c?
Explain about block scope in c?
Can we change the value of static variable in c?
Is using exit() the same as using return?