write a program to interchange the value between two variable
without using loop
Answer / mudita rathore
#include<stdio.h>
void main()
{
int a,b,temp;
printf("enter value of a=");
scanf("%d",&a);
printf("enter the value of b=");
scanf("%d",&b);
temp=a;
a=b;
b=temp;
printf("a=%d b=%d",a,b);
}
Is This Answer Correct ? | 5 Yes | 3 No |
How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include<stdio.h>...
What is c programing language?
What is scope and lifetime of a variable in c?
How do we select the big element or any other operation from array which is read dynamically. user need to give the elements only no need to mention the size.
What is an object?
#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?
Write a program to swap two numbers without using a temporary variable?
Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors
What is c language used for?
Convert the following expression to postfix and prefix (A+B) * (D-C)
Why doesn't the code "a[i] = i++;" work?
What are type modifiers in c?