[ create a new paste ] login | about

Link: http://codepad.org/P8stBJhS    [ raw code | output | fork ]

C, pasted on Apr 29:
#include <stdio.h>

int main()
{
int i = 0;
int len = 0;
char str[] = "reddy";
while(str[i] !='\0')
{
    i=i+1;
    len = len+1;
}
printf("string len=%d",len);

int arr[] = {1,2,3,4,5 };

int numofElem = sizeof(arr)/sizeof(arr[0]);

printf("Num of Elm=%d",numofElem);


return 0;
}


Output:
1
string len=5Num of Elm=5


Create a new paste based on this one


Comments: