Jump to content
ChetanaSforum

Recommended Posts

What will be printed as the result of the operation below:main() { int x=20,y=35; x=y++ + x++; y= ++y + ++x; printf(“%d%dn”,x,y);}

difference b/w char*x and char x[]

In char*x, the variable x is a pointer of character type(a pointer is variable which points(represent) to some memory location)in char x[] the x is a array of character type (like string). :D

Share this post


Link to post
Share on other sites

dude you really need to learn how to post. what are all these quotes ?how about this ?alok.c#include <stdio.h>main (){int a;a=-(-1-1);printf("a is %d",a);getchar();}

Share this post


Link to post
Share on other sites

TANKS 4 UR RESPONSE FRIEND I KNOW THE ANSWER THAT U POSTED. I THINK THE ANSWER MAY IN LOGICAL WAY ONCE AGAIN THINK OF IT AND TRY TO GIVE ANOTHER ANSWER

Share this post


Link to post
Share on other sites

I would like to begin with something like this..a b c v0 0 0 00 0 1 10 1 0 10 1 1 21 0 0 11 0 1 21 1 0 21 1 1 3

Share this post


Link to post
Share on other sites

the sol from my sidepiyush.c#include <stdio.h>main (){int a;a=-(-1-1);printf("a is %d",a);getchar();}

Share this post


Link to post
Share on other sites

Thanks for ur respons bro....here i need a program but u r giving the answer in some other wayandalso i didnt understand ur answer pls try 2 give the answer in programetically

Share this post


Link to post
Share on other sites

x=20,y=35wen X++ it becums 21Y++=36in the first equation x=x++ + y++ The '++' operator when used after the operand will first assign the values and then increments dem.so,in the equatn it'l use the values of x and y as 20, 35 nd den increments dem.it'l b x=20 + 35=>x=55 after assigning x=21 ,y=36 and den x is replaced with the result becums x=55secnd equtn y= ++y + ++xThe '++' operator when used before the operand will first increment and then assigns the values. so,y= 37+ 56=93hope u r clear

Share this post


Link to post
Share on other sites

/* Addition Without + operator */#include<stdio.h>int main(){ int a,b; while (b != 0) { int carry = a & b; a = a ^ b; b = carry << 1; } printf("%d\n",a);}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×