- 1
what is the output of following program type def int integer # define int chat void main () { int i= 65; int *ptr = &i; int *j =
10 Answers
+ 4
Your code is incomplete, please post full code. And also use relevant tags next time...
+ 4
1. Your question got cut up because you put it in the title instead of the question field.
2. Use relevant and only relevant tags.
3. Run it yourself and find out.
+ 3
Well, did you run it?
+ 3
Errors ...
1. No inclusion of <stdio.h>. You use printf().
2. typedef requires original type, followed by type alias.
https://en.cppreference.com/w/cpp/language/typedef
3. #define preprocessor directive is better written without space between '#' and 'define'. Compiler may not care, but you should, for the sake of readability and syntax consistency.
http://www.cplusplus.com/doc/tutorial/preprocessor/
* NOTE: The typedef and #define lines are pointless, might as well remove them.
4. Standard C requires the main function to return `int` not `void`.
https://en.cppreference.com/w/c/language/main_function
5. The number of format specifier and number of data to be printed in call to printf() does not match. There are 3 format specifier, but there are 4 data to be printed.
6. Use of %d specifier for `sizeof` operator, and pointer arithmetic result is inappropriate.
For error #5 and #6 refer to
http://www.cplusplus.com/reference/cstdio/printf/
+ 1
what is the output of following program
type def int integer
# define int chat
void main ()
{ int i= 65;
int *ptr = &i;
int *j = ptr;
j++;
printf ("%d %d %d",!i,size of (i),j-ptr,*&*ptr);}
+ 1
This is the question
0
Syntax error.
This should be c++ right?
If so this code is invalid..
Or did you mean:
#include <stdio.h>
int main ()
{ int i= 65;
int *ptr = &i;
int *j = ptr;
j++;
printf ("%d %d %d",!i,sizeof(i),j-ptr,*&*ptr);
return 0;
}
Then it will return:
0, 4, 1
0
Complete the code buddy.
- 1
2) Consider below two different declarations of
String.
char str[] = "Intelligraphics";
char p* = "Intellingraphies";
Answer whether the following statements
are valid or invalid?
a) str ++ is valid / invalid:
b) P++ is valid / invalid):
) S+r [1] + + is valid / invalid:
d) (*p)++ is valid / invalid:
- 1
Write a function pointer declaration that returns integer and takes a char-pointer and integer value