shameerariff
BAN USER#include <stdio.h>
int a[]={1,3,5,6,8};
int b[]={1,5,6,8};
int main()
{
int i,j;
for(i=0;a[i]!=0x00;i++)
{
int missing =1;
for(j=0;b[j]!=0x00;j++)
{
if(a[i]==b[j])
missing=0;
}
if(missing == 1)
printf("%d",a[i]);
}
return 0;
}
#include <stdio.h>
int arr[]={5,9,8,7,6,10,2,1};
int larg[10];
int main()
{
int dat;
int i,j,k=0,l;
scanf("%d",&dat);
for(i=0;i<dat;i++)
larg[i]=0;
for(i=0;arr[i]!=0x00;i++)
{
for(j=0;arr[j]!=0x00;j++)
{
if(arr[i]>=arr[j])
{
for(k=0;k<dat;k++)
{
if(arr[i]==larg[k])
{
k=dat;
}
else
{
if(arr[i]>larg[k])
{
for(l=dat-1;l>=k;l--)
{
larg[l+1]=larg[l];
}
larg[k]=arr[i];
k=dat;
}
}
}
}
}
}
printf("%d \n",larg[dat-1]);
}
Its written in C
int arr[]={10,9,8,7,9,10,2,1};
int occur(int dat)
{
int i=0,count=0;
while(arr[i]!=0x00)
{
if(arr[i]==dat)
count++;
i++;
}
return count;
}
This is in Objective C
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
{
int i;
for(i=argc-1;i>0;i--)
NSLog(@"%s ",argv[i]);
return 0;
}
A simple C program which can convert the string in reverse
#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
for(i=argc-1;i>0;i--)
printf("%s ",argv[i]);
return 0;
}
Here the statement is y=x++, ie value of x will be assigned to y as 10 and the value of x is incremented(post-increment)
- shameerariff February 12, 2016When the variable x is initialized it is assigned with value 10,when it comes to the statement y=x++, the value of x 10 is assigned to y and x will undergo post-increment so the value of s will become 11.
- shameerariff February 12, 2016
It is a simple program with a little twist.
Do not get confuse with the operator +, you need to split the equation
Hope you are cleared
- shameerariff May 11, 2016