Category: ACM
Last Digit: #include<stdio.h> int main(){ int num,lastdigit; printf(“enter any number:”); scanf(“%d”,&num); lastdigit=num%10; printf(“lastdigit = %d”,lastdigit); return 0;…
code: simple code: #include<stdio.h> int main() { char str[300],ch; int i,frequency=0; printf(“enter string:”); gets(str); printf(“enter character:”); scanf(“%c”,&ch);…
My Own Logic: #include<stdio.h> int main() { char str[200]; int i,j; gets(str); for(i=0;str[i]!=’\0′;i++); for(j=0;j<i;j++) { if(str[0]==str[i-1]){ printf(“Palindrome\n”);…
for maximum: #include<stdio.h> int main() { int ary[7]={-99,45,100,37,89,-327,245}; int i,max=0; for(i=0;i<7;i++) { if(ary[i]>max) { max=ary[i]; } }…
code 1: #include<stdio.h> int main(){ int i; for(i=10;i<20;i++) { if(i%2==0) continue; if(i>16) break; printf(“%d\n”,i); } return 0;…
Problem: **** *** ** * code: #include<stdio.h> int main() { int i,j; for(i=1; i<=4; i++) { for(j=i;…
Recent Comments