#include <stdio.h>
main()
{
char * str = "hello";
char * ptr = str;
char least = 127;
while (*ptr++)
least = (*ptr<least ) ?*ptr :least;
printf("%d",least);
}
Answer / susie
Answer :
0
Explanation:
After ‘ptr’ reaches the end of the string the value pointed
by ‘str’ is ‘\0’. So the value of ‘str’ is less than that of
‘least’. So the value of ‘least’ finally is 0.
| Is This Answer Correct ? | 2 Yes | 0 No |
void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
void main() { int i=5; printf("%d",i++ + ++i); }
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
Is the following code legal? struct a { int x; struct a *b; }
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }