code of a program in c language that ask a number and print
its decremented and incremented number..
sample output:
input number : 3
321123
Answer / kurt s
#include <stdio.h>
int main() {
int n, ncpy;
printf("Input number: ");
scanf("%d", &n);
ncpy = n;
while (ncpy > 0) printf("%d", ncpy--);
while (ncpy < n) printf("%d", ++ncpy);
printf("\n");
return 0;
}
Is This Answer Correct ? | 2 Yes | 1 No |
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
write a c program to print magic square of order n when n>3 and n is odd?
write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
write a c program to Reverse a given string using string function and also without string function
Cau u say the output....?
union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
write a program in c to merge two array
Find the largest number in a binary tree
Printf can be implemented by using __________ list.
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }